PhoneInput
function PhoneInput(__namedParameters: PhoneInputProps): Element;Phone number input with integrated country selection, formatting and validation.
Presentational — always driven by usePhoneInput. Spread inputProps onto it and
wrap it in a <FormControl> you own (spread formControlProps); the component renders its
own error message into that FormControl’s context.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
PhoneInputProps |
Returns
Section titled “Returns”Element
Example
Section titled “Example”const phone = usePhoneInput({ defaultCountry: "SE", isRequired: true });
<FormControl {...phone.formControlProps}> <FormLabel>Phone number</FormLabel> <PhoneInput {...phone.inputProps} placeholder="Enter phone number" /></FormControl>;Docs https://caspeco.github.io/casper-ui-library/components/phone-input