---
title: "Phone Display"
description: "Shows a stored phone number the way its country writes it: the short form at home and the full form abroad. It can add a call link, a flag, and an extension."
url: https://gelatinui.com/components/phone-display
markdown_url: https://gelatinui.com/components/phone-display.md
access: free
install: "npx shadcn@latest add @gelatin-ui/phone-display"
registry_item: https://gelatinui.com/r/phone-display.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Phone Display

> Shows a stored phone number the way its country writes it: the short form at home and the full form abroad. It can add a call link, a flag, and an extension.

Page: https://gelatinui.com/components/phone-display

## When to use it

Best for: A stored phone number, written the way its country writes it.

- Store numbers in E.164 (`+14155550132`) and pass them as `value`.
- Use `link` for a `tel:` link that a phone can dial.
- Use `flag` to show the country flag before the number.

## When not to use it

- To type a phone number, use a [Input](https://gelatinui.com/components/input.md).
- For a postal address, use [Address Display](https://gelatinui.com/components/address-display.md).

## Notes for agents

- `auto` writes the national format when the number's country is the reader's region, else the international format.
- A text that is not a possible number shows as given, with no link, and warns in development.
- The extension word is English by default (`ext.`). Pass `labels.extension` for your language.
- Put a Copy Button next to it, not inside.

## Anatomy

```text
PhoneDisplay
└─ PhoneDisplayEmpty (0..n)
```

## API reference

### PhoneDisplay

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `string \| null` |  | The stored number, E.164 ("+14155550132"). An extension may follow (";ext=204" or " ext. 204"). A text that is not a possible number shows as given, with no link and no flag. |
| `phoneFormat` | `"auto" \| "international" \| "national"` |  | `auto` (default): the national format when the number's country is the region of the locale ("(415) 555-0132" for an en-US reader), else the international one ("+44 20 7946 0958"). |
| `link` | `boolean` |  | Render a `tel:` link (`<a href="tel:+14155550132">`). Default `false`. |
| `flag` | `boolean` |  | Show the country flag before the number. Default `false`; the flags load in their own chunk. |
| `extension` | `string` |  | An extension to add ("204"). Wins over one in `value`. |
| `locale` | `string` |  | The BCP 47 tag that picks the home region of `auto`. Default: the `DisplayLocaleProvider` locale, else "en-US". |
| `metadata` | `MetadataJson` |  | libphonenumber-js metadata, as the Phone Field takes it. Default: the `min` set. |
| `children` | `ReactNode` |  | A `PhoneDisplayEmpty` part: the words of no value. With a value, they are not drawn. |
| `labels` | `Partial<{ extension: string; }>` |  | The words (`PHONE_DISPLAY_LABELS`), to translate them. Keep the object stable. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### PhoneDisplayEmpty

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `data-slot` | `string` |  | The `data-slot` of the root: the item's own slot (`"time-ago"`). Default `"empty-value"`. |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| PhoneDisplay | `phone-display` |  |  |  |
| PhoneDisplayEmpty | `phone-display-empty` |  |  |  |

## Usage

Pass the stored number. Put a `PhoneDisplayEmpty` inside for a contact with no number.

```tsx title="team-phones.tsx"
import { PhoneDisplay, PhoneDisplayEmpty } from "@/components/ui/phone-display";

const CONTACTS: { name: string; phone: string | null }[] = [
  { name: "Priya Nair", phone: "+14155550132" },
  { name: "Tom Becker", phone: "+493012345678" },
  { name: "Lucía Gómez", phone: null },
];

export function TeamPhones() {
  return (
    <ul className="flex w-72 flex-col gap-1 text-sm">
      {CONTACTS.map((contact) => {
        return (
          <li key={contact.name} className="flex justify-between gap-4">
            {contact.name}
            <PhoneDisplay value={contact.phone} link>
              <PhoneDisplayEmpty>No phone</PhoneDisplayEmpty>
            </PhoneDisplay>
          </li>
        );
      })}
    </ul>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/phone-display
```

It adds 23 registry items: 21 files, 4989 lines, and the npm packages `@base-ui/react`, `@maskito/core`, `@maskito/kit`, `@maskito/phone`, `@phosphor-icons/react`, `clsx`, `country-flag-icons`, `libphonenumber-js`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Country Flag](https://gelatinui.com/components/country-flag.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Address Display](https://gelatinui.com/components/address-display.md)
- [Copy Button](https://gelatinui.com/components/copy-button.md)
- [Anchor](https://gelatinui.com/components/anchor.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab | With `link`, moves to the number. |
| Enter | With `link`, opens the `tel:` link. |

## Accessibility

The number sits in a `bdi` with `dir="ltr"`, so the digit groups never flip in right-to-left text.

The flag is decorative. The country code says the country.

The link has a 44px touch target.
