Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
PhoneInputField wraps the PhoneInput UI component inside ShaddyForm’s form context, providing a ready-to-use international phone number input. It renders a country-code selector alongside a formatted number input, calls field.onChange with the full E.164-formatted phone string, and shows validation errors automatically via <FormMessage>.
Installation
Install all ShaddyForm fields at once with theshaddy-form registry item:
Usage
Props
The field name. Must match a key in your Zod schema passed to
ShaddyForm.Label text rendered above the phone input. Omit to hide the label.
When
true, appends a red asterisk to the label as a visual indicator.Disables the underlying
PhoneInput component when true.Additional CSS classes applied to the outermost
FormItem wrapper.Notes
- The value stored in the form state is the full phone string produced by the
PhoneInputcomponent (typically E.164 format, e.g.+14155552671). - Phone number format validation should be handled in your Zod schema — for example using a regex or a library such as
libphonenumber-js. PhoneInputFieldmust be rendered inside a<ShaddyForm>— it readscontrolfromuseFormContextinternally.