Skip to main content

Component conventions

Elevation & shadows​

A surface gets a drop shadow only to signal it sits on a layer above what's directly behind it — the bigger the elevation jump, the bigger the shadow. Flat (border only) is the default; add a shadow to communicate elevation, never for decoration. Use the design-system tokens, not ad-hoc shadow-* values. See ADR 0005 for the rationale.

RoleShadowExamples
In-flow grouped rows / settings / list cardnone (border only)list-rows Card, detail rows, sections
Raised primary content container (on the page background)shadow-prominentdata-table card, stat / summary / ranking cards, the active card, horizontal scrollers
Drawer / sidebar / rail surfaceshadow-sidebarthe sliding aside, station rails
Floating chrome over contentshadow-floatingFABs, floating action toolbars/pills, banners/toasts, overlay CTAs
Modal / dialog / full-screen overlay (over a backdrop)shadow-2xlconfirm dialogs, full-screen overlays

Peer consistency is the rule reviewers enforce: all surfaces in the same role on the same screen get the same treatment. Most inconsistency is a peer mismatch (a raised card next to a flat sibling), not a missing token. Keep the two in-flow card tiers distinct: the iOS-settings list-rows Card stays flat; a primary content container that is a feature's content uses shadow-prominent.

Where components live​

  • Reusable, presentational components: packages/ui/src/ (@enode/ui) — Button, TagPill, Sheet, SortableList, BottomSheetCard, ChoiceMenu (a value button's choices, anchored under the button on a desktop or tablet, a bottom sheet on a phone), LottieCircle, TagsCard, ConfirmDialog, AvatarUploadField, … These are the components worth a Storybook story. (AvatarUploadField is an exception with no story: its real behaviour is the file-pick → canvas crop pipeline, which a static story can't exercise. TagsCard's story covers the row itself — pills, the max fold, the leading slot — with literal-named fixtures; its "Add tag" picker opens against the empty module catalogue, since the catalogue is backend-fed. See the exclusions below.)
  • App-specific feature components: under each app's src/app/ — composed from co-located use-* hooks. Mostly tied to live session state, so generally not good Storybook candidates without a mock.

Form parts​

A form anywhere in the portal or the tracking app is made of the parts below. There is one implementation of each; the Live Hub had its own copies (setting-row.tsx, choice-card.tsx, form-group.tsx under dashboard/live) until 2026-10-13, and has none now.

IdeaPartWhereStory
A group of settings under a labelSettingsGroup@enode/ui/settings/settings-rowssettings/setting-row.stories.tsx
One setting: label, hint, any controlSettingRowsamesame
A value that opens its choicesValueButtonsamesame
A quiet text control under a groupFORM_LINK (a class)samesame
A switchTogglesamesettings/settings-rows.stories.tsx
A compact row with its control built inToggleRow, NumberRow, SliderRow, LinkRowsamesame
One of a few answers, as a cardSelectableCard@enode/ui/selectable-cardselectable-card.stories.tsx
One of a few answers, as a chipChoiceChip@enode/ui/choice-chip—
A labelled input in a drawer's cardFieldRowapps/portal/src/components/field-row.tsx (portal-only)—
A drawerDrawerStack + DrawerView, hosted with useDrawerHost@enode/ui/drawer-stack—

Which won, and why​

  • Setting rows: the Live Hub's SettingsGroup / SettingRow / ValueButton won and moved to @enode/ui/settings/settings-rows. SettingRow takes any control, a hint, and a below layout, and wraps by itself on a phone; ToggleRow / NumberRow / LinkRow each hard-wire one control and a string label, so they could not have drawn the set-up. The compact rows stay as they are — same file, the same idea at the density of a list-rows Card — because the account settings, the tag drawer and the tracking app's settings are drawn with them and were not to change here. New forms take SettingRow; when the settings and users pages are next worked on, ToggleRow and FieldRow should become a SettingRow with a Toggle or an input in it (SettingRow then needs FieldRow's required / optional mark).
  • Choice cards: the portal's SelectableCard won, moved to @enode/ui, and took the Live Hub's ChoiceCard in as layout="row". It had five users, a disabled state and two tones; ChoiceCard had two users and a layout the other lacked (picture, text and mark on one line). The two layouts still mark the chosen card differently — "stacked" with a grey ring that fills, "row" with the shared SelectionCircle and a stronger tint — so that neither the Live Hub nor the export, migration and user pages changed by a pixel. Next time one of those pages is worked on, pick one mark for both (the SelectionCircle is the shared one).
  • FormGroup is gone and nothing replaced it. No screen used it any more once the set-up was rebuilt; only its FORM_LINK class was alive, and that moved beside SettingRow. FieldRow stays the portal's labelled-input row for the user drawer (see the first point for where it should go).
  • "Announce lifts" is a SettingRow with the shared Toggle, not a pair of Off / On chips.
  • The Live Hub's athlete drawer stays (dashboard/live/athlete-drawer.tsx) and is not a SlideOverDrawer. It already stands on the shared DrawerStack / DrawerView and useDrawerHost, like the profile and user drawers, so it is the same shell. SlideOverDrawer is a different wrapper of that shell for wide wizards (roster import, migration, export): 1024 px wide, a plain-text title, mounted only while open, and it tells its caller that it closed 320 ms after the press. The athlete drawer is 538 px, has an avatar in its bar, and tells the board at once — it opens over a running board, whose "which row is open" must not lag behind. Wrapping it would mean overriding the width, the header and the closing, and changing how four board views mount it, for no part saved.

LOOK, Eyebrow, Figure, Stat, Panel​

@enode/ui/live/look is not a second design system. It holds recipes over the tokens of design-system.css: LOOK.panel is rounded-2xl border border-surface-stroke bg-surface-base, LOOK.eyebrow / Eyebrow is the label in small capitals (stat-small, uppercase, muted), LOOK.caption is body-small muted, LOOK.name is heading-normal; Figure and Stat draw a number with its unit, Panel a container with a title. They add no colour and no size of their own — only the wall* entries do, for gym displays (wall-type.ts).

They were written for the Live Hub and are general: SettingsGroup and SelectableCard use them, and any page may. The path keeps live/ in it because some fifty files import it; treat it as a name, not a fence. Stories: live/look.stories.tsx. For the plain grouped card of the account settings (Card, SectionLabel, RowDivider) use @enode/ui/list-rows; LOOK.panel and Card are the same border, radius and surface.

Page head buttons​

A page head (and a drawer head) uses exactly three control types, defined in header-button.tsx. All three are 40 px tall, so the controls in a head line up:

TypeUseComponent
PrimaryThe head's one main action ("New chart", "Create user") — at most one<Button variant="primary" size="header">
SecondaryEvery other labelled action ("Watch the demo", "Catalogues", "Import ▾", "Present")<Button variant="secondary" size="header">, or HEADER_PILL for a menu trigger
IconBack, sidebar, "…", filter, refresh, a phone's short form of an action<HeaderIconButton>, or HEADER_ICON_BUTTON for a menu trigger

Secondary and Icon share one chrome (HEADER_CHROME: surface fill, shadow, surface-stroke-muted ring). Don't use neutral, tertiary or ghost buttons, a muted-fill circle, or a hand-written chrome string in a head.

The same rule holds in both apps and in every kind of head: a page, a drawer (DrawerView), a sheet, a bottom sheet and the tracking app's training screens. Two additions cover the tracking app's heads:

  • Primary icon. A sheet head's ✓ Confirm (next to a ✕ Cancel) is the primary action without a label: HEADER_PRIMARY_ICON_BUTTON, a filled red 40 px circle. At most one per head.

  • Status controls keep their tint, not their own size. The sensor connection pill (ConnectChip), the live-session button, the voice-station button and the distance-threshold button carry a state colour, but all are 40 px tall. The account avatar in a head is drawn at 40 px (AvatarButton size={40}).

  • PageShell's structured actions take variant: "primary" | "secondary" | "destructive" (default "secondary") and render them with size="header".

  • The "How it works" entry is PageShell's help prop, not an action (see walkthroughs.md).

  • On phones a head shows Icon buttons only: the labelled actions fold into the "…" menu, or a page keeps one as its Icon form (Exercises' "+", the result's export).

Portal list pages: desktop table + mobile cards​

The portal's list pages (Users, Exercises, History) render the same rows twice: a DataTable from md up and a card list below it (data-table-view.tsx). The card list gets the table's abilities from mobile-list.tsx:

  • Sort. The page owns the sort (sortState on DataTable) and orders the cards with sortByColumn, so both layouts show one order. The cards offer it through MobileListToolbar's sort sheet.
  • Count + paging. Fully loaded lists show "Showing x of y" and render 25 cards at a time (useShowMore + ShowMoreButton). Server-paged History keeps its pager.
  • Bulk actions. As in the workout builder's drawer, one floating pill at the bottom of <main> swaps its contents: MobileSelectPill ("Select") while browsing, MobileSelectionPill in select mode — the desktop TableSelectionBar in its compact form (the count circle, icon-over-label actions, ✓ apply). As on desktop, the count circle clears the selection; on mobile it also leaves select mode, so there is no separate exit button. In select mode cards draw a SelectMark and toggle on tap, and "Select all" sits above the list. It takes the same SelectionActionItems as the desktop pill; export stays desktop-only. The mobile pill needs its own tag picker instance (its own trigger ref), and the list ends with a MOBILE_PILL_SPACER so the last card clears the pill.
  • Row actions that can't fit a card live where tapping the card leads (the session drawer's Details tab offers the History row actions: change athlete / exercise, inspect profile, delete).

Columns the coach arranges​

A table can let the coach show, hide and arrange its columns (table-columns.ts, columns-menu.tsx). The page declares the columns as ColumnOptions, reads the arrangement with useTableColumns(tableKey, options), passes arrangeColumns(columns, shown) to DataTable, and puts <ColumnsMenu> — a small icon button — into the empty header cell above the row actions (on Users: the header of the actions column). DataTable itself knows nothing about it.

  • Default. Every option that is not defaultHidden, in declared order. A coach who never opens the menu sees the table unchanged.
  • fixed columns (the name) are always first and can be neither hidden nor moved. available: false drops an option whose data does not exist.
  • Ready-made views (views on ColumnsMenu) set an arrangement with one click. The trigger turns from muted to default ink while the arrangement is not the default.
  • Storage. Per signed-in user and tableKey, in localStorage (enode.table-columns.<userID>.<tableKey>); the default is stored as no entry. tableKey and column keys must stay stable across releases — a key that no longer exists drops out of a stored arrangement, a column added later starts hidden for coaches who already arranged the table.
  • Groups. An option's group ("Account", "Training", "Body") sections the menu's list of columns that can be added; the shown ones stay one ordered list with drag handles. Each row has an eye switch.
  • Many columns. A column with sticky: "left" (the name) and one with sticky: "right" (the row actions) stay in view while the table scrolls sideways. Pinning only exists while the table is wider than its card (data-overflow on the scroll container): a table that fits renders plain cells. A table with pinned columns uses separated borders: every cell draws the row separator itself (TableScroll separate), so pinned and scrolling cells share one line. While pinned, the cells paint the row surface and its hover tint with the row's own transition, and show an edge only while content lies under them (data-under-left / data-under-right); give data columns whitespace-nowrap so the table scrolls instead of squeezing them.
  • Sticky header. stickyHeader on DataTable makes the table scroll on both axes inside its card (TableCard bounded, TableScroll with overflow-auto), so the header row sticks with plain CSS position: sticky and the pinned header cells stick both ways above the pinned body cells. The host bounds the height: the Users page uses PageShell fill and flex columns down to the table, so on desktop the table fills the rest of the window and the search and filters stay put. When the rows fit, the card is as tall as its rows.
  • Scope. Desktop table only; the mobile cards keep their fixed layout. Only the Users table uses it so far. Its training columns load their figures only while shown (users/roster-figures.ts; the server ask is in users-table-backend-handoff.md).
  • TODO: store the arrangement on the user's settings on the backend, so it follows the coach across devices (no endpoint yet).

Search and filter bars​

Every portal list page and searchable drawer filters through one compact bar, so a coach finds every filter in the same place and the page stays calm. The parts live in search-and-filter-card.tsx and menu-panel.tsx (stories: UI/SearchAndFilterCard → FilterBarPattern, UI/MenuPanel). A page that needs fewer controls omits them; nothing else moves.

One row at rest​

SearchAndFilterCard, left to right:

  1. Search field (icon, input, clear ✕).
  2. actions — the date window only: DateRangePicker variant="inline" with presets (History). Inline triggers use FILTER_TRIGGER: icon first, icon-only below sm.
  3. "Filters" — the one control for everything else, with the number of applied filters beside it. It opens the Filters menu (next section) on every page with facets or tags; a tag-only page (Workouts, the tracking Library, the user and exercise pickers) gets the same menu with just its Tags section.

There are no permanent facet rows and no inline row labels in the bar.

The Filters menu: the settings-popover vocabulary​

The Filters menu and the tables' Columns menu (columns-menu.tsx) are built from the same parts in menu-panel.tsx, so every settings popover in the portal reads the same:

  • MenuPopover — the white rounded panel (MENU_PANEL, 288 px), portaled under its trigger with the right edges aligned, its height capped to the room below the trigger (long lists scroll inside); closes on a press outside or Escape. On phones the Filters menu shows the same body in a BottomSheetCard, scrolling within 75 % of the screen.
  • MenuPanelHeader + MenuPanelAction — the title row with a red-orange text action: "Reset" in Columns, "Clear" in Filters (shown only while something is applied). Filters makes it sticky, so "Clear" stays in reach.
  • MenuPanelSection — a rule, a small uppercase heading, then rows: one per facet group (filterGroups: roles, tracking source, owner, "Show" for video / not in plan / archived / favourites), then Tags.
  • MenuCheckRow — a full-width row: label, trailing check while on, row tint on hover; a tag row leads with its colour dot.
  • Tags stay in the menu — no second popover or picker. The Tags section first lists the page's suggestedTags (History's most used workout tags) and any other applied tag; MenuExpandRow "Show all tags (n)" expands it in place to every tag in tags (those rows first, the rest by name). With nothing suggested or applied the full list shows straight away. Over six tags, the expanded section starts with a MenuSearchField that narrows the rows (MenuEmptyRow when nothing matches). The menu remembers neither the expansion nor the search between openings.
  • MenuPanelFootnote — a muted note under a rule (Columns' "Drag to arrange…").

Applied filters​

Only while something is applied, a strip under the input lists it, once: neutral AppliedFilterChips (History's "Athlete: …" tokens via appliedFilters, and every active facet option), the applied tags as SelectedTagChips in their tag colours, the "Any tag / All tags" switch with two or more tags (onTagMatchChange), and one ClearFiltersButton at the end. onClearFilters lets the page reset everything in one step (History runs one search); without it the card toggles each active tag and option off.

One chip family​

Every chip in the applied strip has the tag-pill size (stat-small, px-2.5 py-1, 1 px border): SelectedTagChip in the tag's colour, AppliedFilterChip neutral, each with a trailing ✕.

Counts and empty results​

  • A count that local filters make necessary sits under the bar as one body-small text-foreground-muted line (History's "Showing x of y sessions on this page"). Paged tables show theirs in their pagination.
  • A search or filter that leaves nothing renders NoResults (no-results.tsx) in place of the list, with "Clear search" / "Clear filters" and, where the page can find near-matches, "Did you mean" chips.

Kept visible on purpose: navigation, not filters​

  • Content sources — "Mine / Shared with me / Public" on Tags and the template feed's source chips (Workouts' explore drawer, the planner's template picker, the tracking Library): they pick which feed you browse, appear only when there is more than one source, and Tags defaults to "Mine". They stay a chip row under the card.
  • Exercises keeps its visual muscle-map, muscle-group and equipment-icon rows, the whose-figures athlete filter and the usage views between the card and the table — the page's way into the catalogue. Its "Clear filters" is the shared button.
  • Planner has no search field: its filter bar sits in the calendar's chrome, leads with the live count, and adds athletes and tags through "+ Athletes" / "+ Tags" popovers. Applied tags use SelectedTagChip, the clear is the shared button.
  • Profiles (Data → Profiles) sets its timeframe in the sticky ChartRangeToolbar over the analyses pane: it scopes the charts, not the athlete / exercise lists.
  • Exports and the Insights builder pick dates in form fields (DateRangePicker variant="field", TimeframeField) — a form, not a filter bar.
  • Popovers (planner athlete filter, Live hub stream filters, chart legend "Find…", add-to-template picker, Insights spotlight) keep a compact search header inside the popover.

Chart text on canvas​

Chart.js draws on a <canvas>, which doesn't inherit the page's font or the app's text scale (--text-scale). In the portal's charts (chart-setup.ts):

  • ensureChartsRegistered sets chart.js's default font family to the page's font (Roobert) and its tooltip title weight to 500. Without it, chart.js falls back to its built-in Helvetica.
  • Chart options size text with chartFont(theme, size, weight?), never a bare font: { size }. It applies the page font and the text scale.
  • Text a plugin draws itself (end labels, bar values) uses pluginFont(size, weight?) instead of a hard-coded ctx.font family.
  • Sizes and weights come from the type scale in design-system.css: 9 / 11 / 12 / 14 / 15 / 17 / 22 px, weights 400 / 500 / 600 (Roobert has no 700). The PDF / slide renderer (report-render.ts) follows the same scale and waits for document.fonts.ready before drawing.

Chart colours in Insights​

  • Grey by default, metric colour for what's highlighted. On Trend, Correlation and Distribution every series is a neutral grey. Only a highlighted series takes colour, in shades of the chart's metric category colour (velocity pink, power purple, …). Highlighted means focused by the coach, named by the answer, or picked on a crowded chart.
    • Several highlighted athletes: each athlete gets one shade (the full colour first, then lighter and darker steps), shared by all their series. One athlete with several lifts: all in a slightly lighter tint, the hovered lift (legend row or plot) in the full colour. One series: the full colour (withMetricShades in chart-legend.tsx).
    • useMetricHue (metric-hue.ts) resolves the metric.
    • Correlation uses its vertical (y) metric.
    • Until the metric resolves, highlighted series keep SERIES_PALETTE colours.
    • The spotlit athlete stays brand red-orange on every chart.
  • The kicker's metric name (and its unit) takes the chart's metric colour too (ChartSubject.topicColor), so the heading names the colour the plot uses. A Correlation's topic names two metrics, so each metric's label is coloured in its own colour (topicTints, found in the translated topic by tintedTopicRuns). Profile has no single metric and keeps the kicker colour.
  • Correlation dots are two-coloured: a highlighted athlete's dots are split on the diagonal from north-east to south-west: the vertical metric's colour upper-left, the horizontal metric's lower-right, drawn by the splitDots plugin in correlation-chart.tsx; their fit line is neutral grey.
  • Ranking keeps its own marks: top 3 (and a focused athlete) in the metric's colour, one colour without shades; bottom 2 in feedback-warning amber; the rest grey.
  • Better and worse: feedback-success green for better, feedback-warning amber for worse (legend changes, small multiples, "few sets" hints). The trend matrix keeps platinum green for rising and feedback-error red for falling.

Storybook​

Stories document the reusable @enode/ui layer, co-located with the component as ComponentName.stories.tsx. Storybook renders them with the real design tokens (Tailwind v4 + @enode/ui/styles/design-system.css, wired in docs-site/.storybook).

Currently covered:

  • packages/ui/src/button.stories.tsx — all variants, sizes, disabled, rounded pill, leading/trailing icon.
  • packages/ui/src/tag-pill.stories.tsx — contrast swap, no-colour fallback, interactive, long-content truncation.
  • packages/ui/src/confirm-dialog.stories.tsx — destructive vs neutral confirm, child item list, busy (buttons locked during an async action).
  • packages/ui/src/settings/setting-row.stories.tsx — a group of settings (value button, switch, a control under its label), a group without a title, a long value that wraps, the quiet text control.
  • packages/ui/src/selectable-card.stories.tsx — both layouts ("stacked", "row" with and without a picture), the neutral tone, disabled.

Adding a story​

  1. Pick a reusable @enode/ui component with meaningful visual states. Skip provider-only wrappers, route-only pages, and components that need live backend state without a safe mock.

  2. Create ComponentName.stories.tsx next to the component.

  3. Use Component Story Format with TypeScript:

    import type { Meta, StoryObj } from "@storybook/react";
    import { fn } from "storybook/test";
    import { MyComponent } from "./my-component";

    const meta = {
    title: "UI/MyComponent",
    component: MyComponent,
    tags: ["autodocs"],
    args: { onChange: fn() },
    } satisfies Meta<typeof MyComponent>;

    export default meta;
    type Story = StoryObj<typeof meta>;

    export const Default: Story = { args: { /* realistic props */ } };
  4. For ReactNode/callback props, set argTypes: { prop: { control: false } } and add dedicated stories — editable controls produce broken values.

  5. Only document states the component actually supports. Use realistic args, mock callbacks with fn(), never call real APIs, never invent props.

  6. Run npm run storybook to preview, npm run docs:storybook to build.

Sheet has stories for what it does with the keyboard's focus (sheet.stories.tsx).

TODO: BottomSheetCard / SortableList are reusable but need a small amount of mock wiring (portals, drag context). Add stories when those mocks are in place — do not force a story that fakes behavior.

The same applies to NotificationFeed: it subscribes to the module-level notifications store rather than taking items as props, so a story would have to fake the store rather than the component. Its presentational children (NotificationItem / NotificationList / NotificationEmpty) have stories, and its state decision is covered by feed-phase.test.ts.

Settings & account building blocks​

Import paths and exported names:

  • NavRow is the settings and account row in the enode screen look: an optional monochrome icon, label (and sublabel), current value, and a chevron — or an arrow-up-right for external rows (links or buttons that leave the app). It also covers destructive rows such as "Sign out" and rows with a trailing Toggle.
  • ToggleRow, NumberRow, SliderRow stay for compact drawers and existing forms; under the "screen" Settings look they take the screen spacing.
  • Separate rows with NavRowDivider, a full-width hairline.

Page column and cards​

  • SettingsPage is the space-y-6 column of a Settings or Account view; the view's frame (SettingsScreenFrame) provides the page background and centred column.
  • SettingsCardGroup is a bordered bg-surface-base card with an optional heading-section header, an optional quiet footer (may hold a link), and findId, which is set as data-find.

Underline tabs​

  • @enode/ui/underline-tabs: UnderlineTabs, types UnderlineTab, UnderlineLinkTab, UnderlineTabsLink, UnderlineTabsLinkProps, UnderlineTabsProps.
  • One tab row for the portal's Account and Settings pages and the tracking app's Settings screen: the active tab underlined in red-orange, aria-current="page" on it.
  • Router-agnostic. Link tabs (href per tab) render through linkComponent (the portal passes Next's Link; default a plain <a>), with replace for query-parameter tabs. In-memory tabs pass onSelect and render as buttons (the tracking app, which has no router).
  • When the row is wider than its box it scrolls sideways; a fade with a › marks the cut-off side, and the active tab is scrolled into view.
  • SettingsScreenFrame takes the row as its subheader: pinned in the solid header under the title.

Scope band​

  • ScopeBand takes variant="device" or variant="everywhere".
  • It is one quiet line with a glyph. Copy comes from the caller via t(), for example "Only on this device" with a caption, or "On all your devices" with a caption.
  • Put a band above any section whose scope differs from the sections around it.

Saving​

  • Settings save instantly. There is no Save button.
  • Call useSaveFeedback().saved() after a successful save. It shows a brief "Saved" toast, and repeated saves replace the previous toast.
  • On failure, the caller reverts the control and renders SaveErrorLine under the row ("Couldn't save. Try again.").

AvatarButton​

  • A 44 px round button that opens the Account page, showing a photo or, without one, the profile icon on a gradient (never initials — it stands for the signed-in account; athlete lists use AthleteAvatar, which keeps initials). It renders an <a> when given href, otherwise a button.
  • The caller passes the aria-label, for example t("Account").
  • An optional ring can be drawn around it. A smaller size shrinks the circle while the 44 px tap area stays.
  • Used by the tracking app's AccountButton and the portal sidebar avatar.

Portal design consistency: which block for what​

One row per need. Use the shared block; do not hand-write the equivalent.

NeedUseSource
Keyboard focus ringFOCUS_RING (2 px red-orange, :focus-visible only). Already built into Button, the header buttons and SegmentedPicker; add it by hand only to a bare <button> or linkfocus-ring.ts
Orange text vs. brand accenttext-foreground-red-orange (darker, for text/links) vs text-brand-red-orange (#ff4805, icons/tiles/selected pills/badges)design-system.css
Hand cursor / not-allowed cursorNothing: the portal's base layer sets it on every clickable and disabled controlglobals.css
Button size in a headsize="header" (40 px, level with the round icon buttons)button.tsx
Button size elsewheresize="rounded"button.tsx
In-flight savebusy on the Button; the label stays, no "Saving…" swapbutton.tsx
Round head or close buttonHeaderIconButton; HEADER_ICON_BUTTON for a menu triggerheader-button.tsx
Loading stateSkeleton, SkeletonLines, SkeletonRows; never a plain "Loading…" text. The skeleton matches the final layoutfeedback/skeleton.tsx
Disclosure bodyCollapsible open: children stay mounted, inert while closed, no transition under reduced motioncollapsible.tsx
Segmented controlSegmentedPicker: the selected background is one thumb that slides between pillssegmented-picker.tsx
Drawer widthDrawerStack width: "default" (538 px), "wide" (720), "extraWide" (960), "full"; no ad-hoc max-w-[…]drawer-stack.tsx
Pushed drawer view with unsaved stateusePopGuarddrawer-stack.tsx
Drawer form actions (Save, Assign, Apply)DrawerFooter, last child of the DrawerViewdrawer-footer.tsx
Confirm of a picker drawerFloatingConfirmfloating-confirm.tsx
Centred dialogDialogShell (under ConfirmDialog and every custom dialog); z-index DIALOG_Z_INDEXdialog-shell.tsx, surface-z-index.tsx
Walkthrough with one journeyWalkthroughModal with singleFlow: no overview, no Backwalkthrough.tsx
First-run empty tableTableEmptyState with a bare icon and a tone; the primary CTA comes firstfeedback/table-empty-state.tsx
Search or filters left nothingNoResultsfeedback/no-results.tsx
Card surface, eyebrow labelLOOK.panel, LOOK.eyebrow / Eyebrowlive/look.tsx
Absolute or relative date and timeformatAbsoluteDateTime, formatRelativeDayDateTimedate-time.ts
Unit symbolComes from the unit formatter, uppercase (KG, LB); never typed by handunits.ts
A set as "load × reps"LoadRepsLabelload-reps-label.tsx

DataTable columns and rows​

  • A numeric column sets align: "end": header and cells right-aligned with tabular figures.
  • A row with onRowClick opens with Enter or Space when the row itself has focus.
  • The header row is 44 px (h-11).
  • The header sticks under the page header by default (stickyPageHeader, default true). Pass stickyPageHeader={false} inside a drawer or a nested scroll box. stickyHeader (default false) is the variant for a bounded host.
  • Source: data-table-view.tsx.

Popover and menu panels​

  • The panel is rounded-2xl with p-1.5; its rows are rounded-xl.

Elevation​

Feedback copy​

  • One success toast per completed save or delete.
  • A one-phrase toast has no trailing period.
  • A bulk action states the count.
  • Errors go through the error presenter, not a hand-built toast; see error-handling.md.