Skip to sheet

C-502Form controls

Form controls

Fields sit a hair below the page: white, a strong edge, and a recessed inset. Every field looks the same whether you type, choose or search, and every one is 40px tall.

Input

A single line of text. Use Field for its label, hint and error.

Rest
Hover
Focus
Invalid
Disabled
PartTokensNotes
Height40px · h-5Matches a default button, so toolbars line up.
Edgeborder-border-strong#8A919C, 3:1 against white.
Depthbg-raised · inset-shadow-recessedA hair below the page.
Hoverborder-muted-foregroundThe edge darkens; nothing moves.
Focusborder-ring · ring-[3px] ring-ring/25A cyan edge and a soft halo instead of an outline.
Invalidaria-invalid · border-destructivePair it with an error message in Field.

Textarea

Several lines: notes on a detail, a description. It grows with its text from 80px.

PartTokensNotes
Heightmin-h-10 · field-sizing-content80px, then grows.
LookSame as InputEdge, inset, focus and invalid are shared.

NativeSelect

A short list of known choices, like a discipline or a project. The browser’s own menu keeps it fast and accessible on every device.

PartTokensNotes
ChevronCaretDown · 16pxRight inset 16px; the text stops before it.
LookSame as InputOne field look for every field.

Field

The frame around a control: label above, the control, then a hint or an error. The error replaces the hint, in the same place.

PartTokensNotes
Labeltext-sm font-mediumSentence case, no colon.
Hint13/16 · text-muted-foregroundThe format or the consequence.
Error13/16 · text-danger-foregroundSay what to type, not that it was wrong.
Gapgap-1 · 8pxBetween label, control and message.

Switch

An on/off setting that takes effect at once, like approving a detail for use. If the change needs a save button, use a checkbox in a form instead.

PartTokensNotes
Track24 × 40 · rounded-fullOff bg-border-strong, on bg-primary.
Thumb16px · bg-raised · shadow-edgeA raised part on the track, 4px from each end.
LabelBeside the trackName the setting, not the state.

SegmentedControl

Two to four mutually exclusive views of the same list, like All, In review and Approved. The track is recessed; the selected segment is raised.

PartTokensNotes
Trackh-5 · bg-muted · inset-shadow-recessedA 1px border and a 3px inset, so 32px items sit centred.
Selectedbg-raised · shadow-edge · ring-edgeRaised on the track; ink text.
Otherstext-muted-foregroundInk on hover.

RadioGroup

One choice from a few, each with enough to say that it needs a row. RadioCard is the whole row as the target: an ink edge and a pressed inset when chosen.

PartTokensNotes
Radio16px · rounded-full · border-border-strongChecked: an ink dot.
RadioCardrounded · border-border · bg-raised · p-2Hover border-input; checked border-foreground and inset-shadow-selected.