Skip to content
Components

Phone input

International phone field with country search, E.164 values, and Zod validation helpers.

Composition

Country-aware form field

  • <Field>
    • <FieldLabel />
    • <FieldControl>
      • render prop
        • <PhoneInput />
      </FieldControl>
    • <FieldDescription />
    • <FieldError />
    </Field>

Installation

The Control UI source installs this primitive from src/registry/sources/control-ui/ui/phone-input.tsx.

Registry command
See registry manifest

Dependencies

Phone input formattingsrc/registry/lib/phone-input-format.tsUtil
Phone number schemassrc/registry/lib/phone-number.tsUtil
CommandcommandPrimitiveInputinputPrimitiveInput groupinput-groupPrimitivePopoverpopoverPrimitive

Raw code

Primary installed source

src/registry/sources/control-ui/ui/phone-input.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-phone-input-* · 6 knobsHow the cascade resolves
--cui-phone-input-country-border-color<color>var(--border)
--cui-phone-input-country-border-width<length>var(--control-rim-width)
--cui-phone-input-trigger-hover-background<color>oklch(from var(--foreground) l c h / 0.06)
--cui-phone-input-trigger-focus-background<color>oklch(from var(--foreground) l c h / 0.06)
--cui-phone-input-metadata-foreground<color>var(--muted-foreground)
--cui-phone-input-chevron-foreground<color>var(--muted-foreground)