Field
Apple 27 form typography combining labels, controls, descriptions, and validation errors, with vertical, horizontal, and responsive layouts, legends, separators, and Inset Grouped choice cards.
Fully compatible with the standard shadcn/ui JSX API (FieldSet / FieldLegend / FieldGroup / Field / FieldContent / FieldLabel / FieldTitle / FieldDescription / FieldError / FieldSeparator), tuned to Apple 27 form typography:
- Responsive typography: Labels use 15px (iOS
Subheadline) on mobile ↔ 13px on desktop; descriptions and errors use 13px (Footnote) ↔ 11.5px. - Semantic colors: Errors consistently use Apple Red (
--apple-red), and links inside descriptions inherit the theme accent color. - Choice cards: Wrapping a
FieldinsideFieldLabelrenders a rounded grouped option card (18px mobile ↔ 12px desktop) with an accent border and soft tint when selected.
Form Field Composition
Installation (Shadcn Registry)
npx shadcn@latest add @apple-liquid/fieldChoice Card
Usage
import { Field, FieldDescription, FieldLabel } from '@/components/ui/field';
import { Input } from '@/components/ui/input';
export function Example() {
return (
<Field>
<FieldLabel htmlFor="name">Name</FieldLabel>
<Input id="name" />
<FieldDescription>Displayed on your Apple Account.</FieldDescription>
</Field>
);
}Props API
| Component | Prop | Type | Description |
|---|---|---|---|
Field | orientation | 'vertical' | 'horizontal' | 'responsive' | Field layout (responsive adapts based on FieldGroup container width) |
Field | data-invalid | boolean | Marks invalid state, switching labels/errors to Apple Red |
FieldLegend | variant | 'legend' | 'label' | Section legend typography scale |
FieldError | errors | Array<{ message?: string }> | Deduplicates and renders validation error messages |
FieldSeparator | children | ReactNode | Optional centered divider label |
Empty
Apple 27 empty state inspired by ContentUnavailableView, featuring a rounded icon tile, prominent title, secondary description, and action slot (20px mobile ↔ 15px desktop title).
HoverCard
macOS 27 22px-radius Liquid Glass hover preview card for user profiles, link summaries, and quick design-spec previews with automatic touch-input adaptation.