Skip to content

Components

Button

The primary action trigger. Needs distinct default, hover, active, focus, disabled, and loading states. Never more than one primary button in the same view.

SaveCancel

Keep one primary button per view and give every interaction state a distinct treatment.

Input

A text entry field. Needs a persistent label above it, not just a placeholder. Each state (default, hover, focus, error, disabled) should be visually distinct.

Pair every input with a persistent label above it and clear focus, error, and disabled states.

Textarea

A multi-line input. Needs the same state treatment as a single-line input.

Multi-line inputs need the same label, focus ring, and error feedback as single-line fields.

Select

A dropdown for choosing one option from a list. The native HTML element is accessible but hard to style. Custom selects need careful keyboard and focus handling.

Native selects provide keyboard navigation and accessibility out of the box.

Checkbox

A toggle for a binary choice. Clicking the label should toggle it, not just clicking the box itself.

Checked

Click the text label itself — the whole label toggles the checkbox, not just the square.

Radio group

A set of options where exactly one can be selected. Distinct from checkboxes, which allow multiple.

Billing cycle

Radio buttons enforce a single choice from mutually exclusive options.

Switch

A toggle for an on/off state. Implies an immediate effect. Use for settings that take effect without a save action.

Slider

A control for selecting a value within a range. Should update the value live on drag, not only on release.

Sheet

A panel that slides in from the screen edge. Common on mobile for secondary navigation or contextual actions. Same focus and dismissal rules as a modal.

Drawer

A bottom sheet that pulls up from the base of the screen. A common mobile replacement for a dialog.

Popover

A small overlay anchored to an element, triggered by click. Can contain interactive content like links or buttons. Different from a tooltip, which cannot.

Tooltip

A small label on hover that explains an element. Cannot contain interactive content. If you need a link inside it, use a popover.

Toast

A temporary notification that auto-dismisses. Duration should reflect reading time, not a flat 2 seconds regardless of length.

Badge

A small label attached to another element. Implies a count when numeric. When it carries a word like New or a status label, it behaves more like a tag and needs different treatment.

Tag

A label that categorises content. Tags are standalone, selectable, or removable. Badges are attached and informational. They are not the same thing.

Accordion

Stacked sections that expand and collapse. Good for FAQs and secondary content. Not a substitute for tabs when users need to compare across sections.

Tabs

Switches between related views in the same space. Best for filtering the same content by time or category. Not for navigating unrelated sections.

Stepper

A multi-step flow that shows progress through a sequence. Showing all steps upfront sets expectations. Hiding them creates anxiety.

Pagination

Controls for moving between pages of content. Use when the full list is too long to load at once. Infinite scroll is an alternative with different tradeoffs.

Skeleton

A placeholder that holds the shape of content while it loads. Keeps the layout stable and signals what’s coming. Better than a spinner for list and page loads.

Spinner

An indeterminate loading indicator. Good for short action-level waits. For page or list loads, a skeleton is almost always better.

Avatar

A small image representing a user or entity. Needs a fallback when the image fails, usually initials or a generic icon.

Card

A contained surface grouping related content. The inner radius should be smaller than the outer, calculated from the padding. Making the full surface a link makes text selection impossible.

Data table

A structured grid of rows and columns. Numbers should be right-aligned with tabular nums. Proper alignment does the work zebra striping is often used to compensate for.

Combobox

An input that filters a dropdown as you type. Combines the feel of a text field with the constraints of a select.

Command menu

A keyboard-triggered search interface for navigating or executing actions. Common in tools where power users want to avoid the mouse.

Progress

A bar showing completion through a determinate process. For unknown durations, use a spinner instead.

Separator

A visual divider between items or sections. Often overused when better spacing would do the same job.

Empty state

What a view shows when there is no content yet. Should explain why and offer a first action. No items found tells the user nothing.