International Input
A universal international input component featuring a country flag dropdown and mode-based format placeholders for phone numbers, timezones, country codes, and currencies.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | required | The unique identifier for the component wrapper. |
mode | InternationalInputMode | 'phone' | The input mode: 'phone' | 'country' | 'timezone' | 'currency' | 'dialCode'. |
selectedCountry | string | 'US' | The selected ISO country code. Supports $bindable. |
dialCode | string | '+1' | The selected international dial code. Supports $bindable. |
value | string | '' | The input text/phone value. Supports $bindable. |
placeholder | string | undefined | Custom placeholder. If omitted, uses the country's example format for the current mode. |
searchPlaceholder | string | 'Search country...' | Placeholder text for the country search input. |
disabled | boolean | false | Whether the input is disabled. |
variant | string | '' | User-defined variant name, added to the root element. Style it with a CSS rule that starts from the root. |
Samples
1. Phone Number Mode
Features a country flag & dial code dropdown with numeric-only phone input and greyed-out format placeholder.
Selected: US | Dial Code: +1 | Value:
<script> import { InternationalInput } from 'fluid-ui-svelte/prebuilt'; let phoneNumber = $state(''); let selectedCountry = $state('US'); let dialCode = $state('+1');</script> <InternationalInput id="user-phone-input" mode="phone" bind:value={phoneNumber} bind:selectedCountry bind:dialCode/>2. Country Only Mode
Clean country picker without an extra input field.
Selected Country: US
<script> import { InternationalInput } from 'fluid-ui-svelte/prebuilt'; let selectedCountry = $state('US');</script> <InternationalInput id="user-country-picker" mode="country" bind:selectedCountry/>3. Currency Mode
Flag and currency selector paired with a numeric amount input.
Country: US | Amount:
<script> import { InternationalInput } from 'fluid-ui-svelte/prebuilt'; let amount = $state(''); let selectedCountry = $state('US');</script> <InternationalInput id="user-currency-input" mode="currency" bind:value={amount} bind:selectedCountry/>