Components / Data & content
Phone Number
Component + managerDisplays a phone number with an optional button to initiate a call. Combines country code and main number, and handles dialing via a clickable button.
Live preview
Interactive exampleUsage
Import the component and its manager, then make it your own.
Component
PhoneNumberManager
create_phone_number_manager<script>
// Import the shared stylesheet once in your application's root layout.
import "sveltekit-ui/style.css"
import { PhoneNumber, create_phone_number_manager } from "sveltekit-ui"
const manager = create_phone_number_manager({ val: "+12025550123" })
</script>
<PhoneNumber {manager} />API reference
Configure the manager, call its methods, and read its reactive state.
3 entries in configuration
| Property | Type | Default | Description |
|---|---|---|---|
val | object or string or null | null | Initial phone number value. If an object, should include `country_code` and `main_number`. If a string, treated as the full phone number. |
main_number | string or null | null | The main part of the phone number without the country code. |
country_code | string or null | null | The country code part of the phone number (e.g., '+1'). |