Design System

Component reference ​

The components, the vocabulary and what is enforced. For what these mean, see Overview. For how to apply them, see Usage.

What the API accepts ​

PassedReaches the component
data-*Yes
aria-*Yes, on a labelled control it lands on the input
A listenerYes
id, name, formYes, and a labelled control claims id for its input
classNo
styleNo
A pass-through objectNo
Any prop whose value becomes a classNo

The filter is an allow-list, so anything not named above is refused without a rule being written for it. A labelled control is one of CInput, CSelect, CCheckbox, CRadio, CToggle and CSegmented.

The components ​

GroupComponents
ActionsCButton, CExternalLink, CInternalLink
FieldsCInput, CSelect, CCheckbox, CRadio, CToggle, CSegmented, CAutoComplete, CSearchBar
ContainersCCard, CWell, CDialog, CTabs, CTab
DataCTable, CTree, CReorderableList, HexViewer
MenusCMenu, CContextMenu, CDropdown
StatusCTag, CToast, CProgress, CLoading
TextCLabel, CEditableLabel, CSecretLabel, CIcon, MarkdownRenderer
LayoutStack, HStack, VStack, StackItem
ScrollingCHorizontalScroll, CVerticalScroll

Fifteen refuse attributes today: CButton, CCard, CCheckbox, CDialog, CInput, CLoading, CMenu, CRadio, CSegmented, CSelect, CTable, CTabs, CTag, CToast and CToggle. The rest still merge what a caller passes.

The layout components ​

PropAccepts
gap0, 1, 2, 3, 4, 6, 8, 12, defaulting to 2
directionhorizontal, vertical, on Stack only, defaulting to vertical
padding, paddingBlock, paddingInlineThe same eight
wrapA boolean
grow, shrinkA boolean, on StackItem only
justify on Stack, alignX on HStack, alignY on VStackThe main axis: start, center, end, between, defaulting to start
align on Stack, alignY on HStack, alignX on VStackThe cross axis: start, center, end, stretch, baseline, defaulting to stretch, or to center on HStack

The eight are the spacing rungs, expressed as a closed union. There is no ninth value to pass.

The vocabulary ​

AxisShared union
severitycontrast, secondary, success, info, warn, danger, referred to below as the six
variantsolid, text, outlined
sizesmall, medium, large

Each component narrows, extends or replaces those unions in its own type.

ComponentAxisAcceptsDefault
CButtonseverityThe six, plus primarycontrast
variantsolid, text, outlinedsolid
sizesmall, medium, largemedium
CInput, CSelectsizesmall, largesmall
CTagseverityThe sixAbsent, which renders the pill with no severity colour
categoryamber, azure, fern, lime, magenta, rust, teal, violetAbsent
widthsmall, mediumAbsent
CDialogwidthsmall, medium, largeAbsent
CIconsizemarker, messageAbsent

Two components spell the axis width because what it sets is a width rather than a whole control. CTag carries a second axis for kind rather than severity, and setting it suppresses the first, because a thing is either being ranked or being distinguished. CIcon sizes an icon rather than a control, so its size leaves the shared union entirely.

State ownership ​

Owned byWhat
The componentHover, press, and the appearance of disabled
The callerWhether it is disabled, what is selected, and the value

Focus is not in that table because it belongs to neither. One global indicator is drawn for the whole interface, which is why the preset draws none.

Inside the library a caller never writes an interaction state, and there are only a handful of hover classes in it, every one inside a component.

What is enforced ​

RuleChecked by
An off-ladder gap or paddingThe type, on the layout primitives only
A class, style or pass-through reaching a componentThe component, which refuses it
A missing required propThe type
A raw colour, an arbitrary value, a primitive token, a stock colourA lint rule, at error
A legacy token, a ramp step, a preset size, weight or radius nameA lint rule, at error
An inline style or a style blockA lint rule, at error
A colour class whose token is unpublishedA lint rule, at error
An escape written without a reason beside itA lint rule, at error
Any other class that resolves to nothingNothing
A rung passed as a utility class rather than a propNothing

The layer carries no suppressed violations and six written exceptions to a design rule, each an eslint-disable comment naming its reason at the site.

What not to write ​

AvoidInstead
class on a componentA default, a prop, or layout in the parent
A prop whose value is a class under another nameThe semantic prop it was standing in for
!important at a call siteThe thing the API was missing
A margin on a child for spacinggap on the group
A colour name in a component's propsseverity, which names the meaning
A count taken by tag nameThe same count taken by import