Capture international phone numbers with country selection, local formatting, and E.164 normalization.
<flux:phone country="US" label="Phone number" />
<flux:phone wire:model="phone" country="US" />
Set the country used for an empty number. The selected country updates automatically when a user enters an international number.
<flux:phone country="GB" />
Use countries to limit the picker to countries your product supports.
This only controls the picker, not the numbers users can enter. Validate country restrictions on your server.
<flux:phone :countries="['US', 'CA', 'GB', 'AU']" />
Use country-order to put common choices first. The remaining countries in the picker follow alphabetically in the app's locale.
<flux:phone :country-order="['US', 'CA', 'GB', 'AU']" />
Use the filled variant where other form controls use it.
<flux:phone variant="filled" />
Use the same compact sizes as other Flux inputs.
<flux:phone size="sm" /><flux:phone size="xs" />
Use disabled to prevent interaction, or readonly to preserve the value without allowing edits.
<flux:phone disabled /><flux:phone readonly />
Use invalid to show the same error treatment as Flux inputs.
<flux:phone invalid />
|
Prop
|
Description
|
|---|---|
| wire:model |
Binds the phone number to a Livewire property. Possible numbers are normalized to E.164; incomplete or unparseable entries are preserved as typed.
|
| value |
Initial phone number as an E.164 string.
|
| name |
Name submitted with a plain HTML form.
|
| country |
Initial ISO 3166-1 alpha-2 country code. Omit it when there is no useful default.
|
| countries |
Array of ISO 3166-1 alpha-2 country codes available in the picker. Does not restrict entered numbers.
|
| country-order |
Array of country codes shown first in the picker.
|
| placeholder |
Hint displayed when the phone number is empty.
|
| size |
Size of the control. Options: sm, xs.
|
| variant |
Visual style. Options: filled. Default: outline.
|
| label |
Label text displayed above the control.
|
| description |
Help text displayed above the control.
|
| disabled |
Prevents interaction with the country picker and phone number.
|
| readonly |
Preserves the value while preventing edits.
|
| invalid |
Applies error styling to the control.
|
|
Attribute
|
Description
|
|---|---|
| data-flux-phone |
Applied to the root element for styling and identification.
|