Using the parts
The toast, icons, default looks, label, field heights, inks, cursors, cards
- Mount
<Toaster />once, in the app's root (App.tsx or the root layout, beside the screens), never per page:toast()shows nothing without it.toast('Saved')andtoast.success('Saved')take the title alone;toast({ title, description, action })the whole card. - Icons are names. An
iconprop takes a pack icon name from the index's Icons (icon="plus", the Tabler outline pack's own name), never an element; the type isIconNamefrom@/lib/goop/trail/glyph. A name the theme lacks draws a neutral ring: pick the nearest it has. Where a part takes an element (amark), draw a pack icon with<Glyph icon="star" box={{ w: 14, h: 14 }} />(Glyphfrom the same file; 12, 14 or 16 px). Icons for an order's way and stock movements:shopping-cart,clock,truck,truck-return,package-import(goods in),package-export(goods out). - Compose, never restyle. A page says what each part already sets (height, padding, colours …): add no class for those. A layout of your own uses the token classes of the index only.
- Six parts' left-out look is not
default. Button isprimary, the filled accent one, and IconButton isoutline, the framed button (variant="primary"is its filled accent one); neither has adefault; CopyButton is the quietghostbutton atsize="sm"(24 px); NumberRoll'ssizeis thebasetype step; ToggleGroup's toggles aresoft; a TopBarAction isoutline. Write the prop for any other look. - A few words are a part's own. IconButton
shape="pill-start"/"pill-end", the two halves of a split pill; MenuButtonshape="icon", the round icon-only trigger;variant="primary"(Button, IconButton, Link, Banner, StatusMark), in the accent;shape="field"(SelectTrigger, Combobox, MultiSelect, PersonSelect), the picker's field; Avatarsize="2xs"and"3xs", belowxs; Dialogsize="full", the page less its gutters, andvariant="window", the floating window; ListGroupvariant="compact", the tighter bar; NumberInputwidth="fixed", 180 px at every width; PriorityMarklabel,truefor the level's own words; Skeletonshape="rounded-top", the first row of a loading stack. labelis a part's name in words. On about 40 parts (Field, ChoiceGroup, Stat, a BarList row, a TreeView item, StatusMark, SearchInput, Spinner, Wizard …)labelholds the words that name it: shown where the part shows them, said to a screen reader alone where it shows none (SearchInput's, Spinner's, the dots of a PaginationEllipsis). It is the name, not a secondaria-label: where a part takes both,aria-labelwins.- A field is a step taller than a Button. A
TextInputis 28, 32 and 36 px (sm,md,lg); a Button is 24, 28 and 32 px. In one row, a field atsmsits level with a Button atmd, and a field atmd(the default) with a Button atlg. One field is off that step: a SelectTrigger atsmis 24 px, a small Button's height, for a value in a settings row or a card (atmd, its default, it is 32 px, a TextInput's). An editable quantity in a table row is aNumberInputstraight in its cell, itsaria-labelnaming the row (lookup.mjs part NumberInput --fullshows one). - Text has three inks:
text-foregroundfor what is read,text-muted-foregroundfor secondary text,text-subtle-foregroundonly for placeholders and decorative icons (too faint to read). - The keyboard focus ring installs itself: nothing to call.
- The theme sets cursors: the hand on what you can press, the text caret in fields, not-allowed on a disabled control. Don't override them unless the element is not interactive.
- Inside a card:
CardContentandCardList. An outline card's own words or content go inCardContent, its rows inCardList(each the theme'sItemon anli): the rows run edge to edge, their words and hairlines on the card's inset, and with no rowsemptyshows the theme's Empty row. A tile's title and description go inCardText. Never adivorulpadded by hand inside a card. A picture beside a header's title (a progress ring, an avatar, an icon tile) goes inCardMedia, first in theCardHeader, never straight in the header.