field
a label, control and supporting words kept together. fieldsets group related choices, and errors lead with a bang square.
bunx --bun shadcn@latest add @mk/fieldexample
edit the run name to see validation change with it. the description names the accepted format; the switch keeps its own label and description.
orientations
vertical stacks label and control; horizontal keeps them in one row. responsive follows the field group width, stacking below its medium container size. the narrow frame shows that change.
vertical
horizontal
responsive
responsive, narrow frame
vertical
horizontal
responsive
responsive, narrow frame
parts
the label legend uses interface type. choice cards edge the checked field in foreground. a plain separator divides the parts, and an error list removes duplicate messages.
on a layer
a separator’s words take the fill beneath them, so in a dialog or a sheet they sit on the layer’s own fill, with no box. each frame stands in for the window.
states
the label follows invalid and disabled states while the control owns its edge. each error carries its glyph and names the next step.
shown on the board
rest
label, box and description
shown on the board
hover
input edge stays quiet
shown on the board
focus
box owns the inside edge
invalid
error label and bang square
invalid, focus
error edge stays inside
shown on the board
disabled
disabled label and control
shown on the board
rest
label, box and description
shown on the board
hover
input edge stays quiet
shown on the board
focus
box owns the inside edge
invalid
error label and bang square
invalid, focus
error edge stays inside
shown on the board
disabled
disabled label and control
phone
at 600 px and below every control that takes text sets 16 px, so ios safari never zooms the page in on focus. a textarea sets 16 on 24 and still opens three lines tall. labels and descriptions keep their steps. these frames have a 390 px viewport.