UI
Components
The components I reach for when I build an interface, each a shadcn component you can add to your own app; it takes on your theme, the way it takes on mine here. Every page has live examples to poke at, with the reasoning behind each one: when to validate a field, where focus goes after a dialog, what an empty list should say.
Start here
Actions
5- Buttonshadcn's Button with a loading state (a spinner over the label, and the button keeps its width) and shapes: slant leans it, and a new shape is one line.
- Copy ButtonThe copy button from shadcn's docs, installable: built on Button, with a fallback where the Clipboard API is blocked, icon-only or labeled, confirming for 2s.
- Button Groupshadcn's ButtonGroup: related actions in one row or column, joined at the borders, which works as a toolbar and can hold text, inputs and selects.
- Paste ButtonThe Copy Button's other half: reads the clipboard into a field, icon-only or labeled, confirms for 2s, and tells screen readers what happened.
- Toggleshadcn's Toggle: a button that stays pressed until it's pressed again, in default and outline variants and three sizes, with aria-pressed set.
Forms
13- Labelshadcn's Label in the theme's foreground color. It names the control it's for, and dims along with it when the Field around them is disabled.
- Fieldshadcn's Field, wired: the label, description, error and success messages connect to the control on their own, and invalid, disabled and required reach it.
- Inputshadcn's Input with sm, default and lg sizes to match the Button. Inside a Field it wires itself up: id, description, error and disabled state.
- Textareashadcn's Textarea that grows with its content up to a limit, then scrolls. Inside a Field it wires itself up, like the Input, with no extra props.
- Input Groupshadcn's InputGroup with the Input's sizes: icons, text and buttons inside one border, and a click on an addon focuses the field it sits beside.
- Password InputA password field with a show/hide toggle that keeps the caret in place, and a Caps Lock warning that screen readers announce as it appears.
- Number InputA whole-number field with the numeric keypad on phones, arrow-key and button steppers, and clamping to its min and max when the field loses focus.
- Requirement ListA field's rules, shown before the first keystroke and ticked off as each is met, so nobody learns the password policy from an error message.
- Error SummaryThe GOV.UK error summary: on a failed submit it takes focus, counts the problems and links each one to its field.
- Selectshadcn's Select. Inside a Field the trigger wires itself up, so the FieldLabel names it and the Field's description and error state reach it.
- Checkboxshadcn's Checkbox. Inside a Field it wires itself up, so the FieldLabel beside it names and toggles it, and the Field's state reaches it too.
- Toggle Groupshadcn's ToggleGroup: a segmented control for one choice, or a row of toggles for several, joined or spaced, horizontal or vertical.
- File DropA region that takes a dropped file or one chosen from the picker, through a button or a large dashed target, and marks itself while a file is dragged over.
Overlays
3- Hover Cardshadcn's HoverCard that can load its content on intent: give it a load function and a cache key, and render the loading, loaded and error states.
- Dialogshadcn's Dialog: a modal that traps focus while open, closes on Escape or a click outside, and hands focus back to whatever opened it.
- Tooltipshadcn's Tooltip that works without a provider around the app: a lone tooltip brings its own, and one inside a TooltipProvider uses that one.
Feedback
4- Skeletonshadcn's Skeleton: a pulsing placeholder sized to the content that's coming, so the page doesn't jump when it arrives.
- Spinnershadcn's Spinner, for waits with no shape to hold: an animated icon that screen readers announce as Loading, sized like any other icon.
- Emptyshadcn's Empty: what goes where there's nothing yet, nothing matching, or nothing left, with an icon, a title, a description and a next step.
- Alertshadcn's Alert: a message that stays on the page and is announced when it appears, with a title, a description, an action slot and a destructive variant.
Data display
4- TimestampAn instant in the viewer's timezone with the zone always visible; on intent, the same instant where it happened and in UTC.
- Separatorshadcn's Separator: a hairline between groups of content, horizontal or vertical, hidden from screen readers unless it's marked as meaningful.
- Kbdshadcn's Kbd, for showing the key next to the action it triggers, and KbdGroup to set a shortcut of several keys, like Ctrl + K, on one line.
- Cardshadcn's Card: a header, content and footer in one rounded panel, in two sizes, with a title that can be a real heading.