Skip to content

InputsLumen Halo

Phone FieldProv1.0.0

A phone number in one well: the country in its own compartment (search 240+ by name, code or dial code), the number formatting as you type, and three cells that light as it becomes possible, then valid. Paste +44… and the country follows; the value is E.164.

libphonenumber-js

.md
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-phone-field

Needs your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.

Set up the Beautiful UI registry

Free pieces install from their URL with no setup (that URL gives the Base UI build; Radix projects use /r/radix-nova/<name>.json, or add the registries below and the CLI picks your build). Pro pieces need the registries below and BEAUTIFUL_UI_TOKEN in .env.local.

components.json
{
  "registries": {
    "@beautiful-ui": "https://beautiful-ui.dev/r/{style}/{name}.json",
    "@beautiful-ui-pro": {
      "url": "https://beautiful-ui.dev/r/pro/{style}/{name}.json",
      "headers": { "Authorization": "Bearer ${BEAUTIFUL_UI_TOKEN}" }
    }
  }
}

MCP server

claude mcp add --transport http beautiful-ui https://beautiful-ui.dev/api/mcp
Catalog for agents: /llms.txt

Usage

Import it and pass your content. The props that matter most are listed next.

Example
"use client";

import * as React from "react";
import { PhoneField } from "@/components/ui/lumen/controls/phone-field";

export function SignUpPhone() {
  const [phone, setPhone] = React.useState<string | null>(null);
  return <PhoneField name="phone" defaultCountry="GB" preferredCountries={["GB", "US", "IN"]} onValueChange={setPhone} />;
}

Props

  • defaultValue / value–

    string (E.164)

    Such as "+442071838750"; the field reads the country from it.

  • onValueChange–

    (e164 | null, details) => void

    E.164 once the number is possible, else null; details has country, national digits, possible and valid.

  • defaultCountry / country / onCountryChange"US"

    CountryCode

    The starting or controlled country (ISO 3166 code).

  • preferredCountries–

    CountryCode[]

    Listed first in the picker.

  • locale"en-US"

    string

    The language for country names (Intl.DisplayNames). Pass your app's locale.

  • name–

    string

    A hidden input sends E.164 with the form.

Show all 7 props
  • labels–

    object

    Every word: country, search, noMatch, possible, valid, incomplete.

Source

components/ui/lumen/controls/phone-field.tsx

This component is included with Pro.

Try the live preview above. Get Pro to install the source.