PhoneField

Displays an E.164 phone number as a formatted label, optionally wrapped in a tel: link.

Installation

pnpm dlx shadcn@latest add @shadmin/phone-field

Usage

import { PhoneField } from '@/components/admin';
 
<PhoneField source="phone" />
<PhoneField source="phone" displayFormat="international" />
<PhoneField source="phone" link={false} />

Props

PropRequiredTypeDefaultDescription
sourceRequiredstring-Record field to read
displayFormatOptional"national" | "international""national"Format style
linkOptionalbooleantrueWrap value in a tel: link
emptyOptionalReactNode-Fallback when value is null
classNameOptionalstring-CSS class

Storage format

E.164 strings (e.g. +14155552671). Unparseable values render as raw strings.