frontend/src/kit/ui/README.mdView source ↗
English source · 2 min
kit/ui
Accessible atoms, molecules and headless primitives. The components carry no text
of their own: every label, title and message comes from the caller, so the
localization contract stays with the screens that use them. Styles use only design
tokens from kit/tokens.
Modules
index.ts: The public interface; import only this file from outsidekit/.primitives.ts: Headless focus trap, roving focus, controllable state and outside-press handling.Button.tsx:Button(tones, sizes, busy state) andIconButton(required accessible label).Feedback.tsx:Badge,Spinner,Notice(alert for danger, status otherwise),EmptyState,VisuallyHidden.Field.tsx:Fieldbinds label, hint and error to its control;TextInput,TextArea,Select,Checkbox,Switch.Dialog.tsx: Modal dialog with focus containment and restoration.Tabs.tsx: WAI-ARIA tabs with roving focus.Menu.tsx: WAI-ARIA menu button.Layout.tsx:StackandCardon the spacing scale.props.generated.ts: Document prop types generated from the component catalog; tones, sizes and layout options come from here. Do not edit.ui.css: Component styles; the architecture check refuses colour literals here.
Every component is declared in the component catalog; a
unit test fails when an exported component has no entry. The living gallery is
the Studio developer page (#merchant → Developer → Components) and the
handbook's component gallery.
Verification
Run npm test -- kit-ui component-catalog and npm run architecture from frontend/.