# @umriss-ui/core

A React component library for data-dense dashboards, monitoring and tools:
forms, date pickers, overlays, a tree view and a command palette.
Guiding idea: **precise and quiet, with palpable quality** – depth comes from
soft shadows and fine light edges, not from hard outlines or effects.

The design language — "Ink & Paper", the dark theme, motion — is written down
once for all seven packages in [`../../docs/design-language.md`](https://github.com/romanhaendler/umriss-ui/blob/main/docs/design-language.md).

## Use

```bash
pnpm add @umriss-ui/core
```

The demo is the documentation.
Every prop of a props table is linked to the examples that show it, some pages
open with a configurator, every export is listed in [API.md](https://github.com/romanhaendler/umriss-ui/blob/main/packages/core/API.md), one search finds
across all seven packages, and the header switches the examples to German.
For a coding agent the same material stands as one Markdown file inside the
installed package, `docs/llms-full.md`, pinned to that version — every page
with its examples' source, its props tables and why it is built as it is, and
an index of every export with its comment and its declaration. The running documentation of a version is opened as [the repository README describes](https://github.com/romanhaendler/umriss-ui#see-it-running): check out the tag `<package>-v<version>`, then `pnpm start`.
In an application:

```tsx
import { Button, Card } from "@umriss-ui/core";
```

Nothing else is required. React 19 or newer as a peer. TypeScript 5.4 or newer (the declarations use `NoInfer`).

The package ships ES2022 syntax; an application that serves older browsers
transpiles it itself.

Every entry, `./wording/de` included, begins with `"use client"`, the directive a framework
with Server Components reads to treat a module as client code. Core's components render from a
Server Component with props React can serialise; a function prop (a handler, a render prop) is
callable only in a client file. No test runs inside such a framework: the package is rendered to a
string in a test, and the fields' widths a server writes into the markup are checked there.

### Server Components

A Server Component fetches the data and hands it to a Client Component. The views - table, chart,
schedule, dashboard - are declared by their hook, so the declaration stays in a client file next to
them, with its `rowKey`, columns and formatters. Only the rows cross the boundary:

```tsx
// app/orders/page.tsx - a Server Component
import { OrdersTable } from "./orders-table";
import { loadOrders } from "@/lib/orders";

export default async function Page() {
  return <OrdersTable rows={await loadOrders()} />;
}
```

```tsx
// app/orders/orders-table.tsx
"use client";
import { useTable } from "@umriss-ui/table";
import type { Order } from "@/lib/orders";

export function OrdersTable({ rows }: { rows: Order[] }) {
  const { Table, Column } = useTable(rows, { rowKey: (o) => o.number });

  return (
    <Table aria-label="Orders">
      <Column value="number" label="Order" rowHeader />
      <Column value="customer" label="Customer" />
      <Column value="quantity" label="Quantity" />
    </Table>
  );
}
```

On a server, and until the page has hydrated, a date or time is empty, because only the browser
knows the reader's zone - unless the application names a time zone in its formats (see Time zone).

The calculation is the one view a Server Component writes itself: its tree is read where it is
written (see `@umriss-ui/calculation`). The reasons are in
[ADR-0067](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0067-a-server-component-hands-umriss-its-data-and-writes-only-a-calculation.md).

### What an import costs

An application whose bundler shakes the tree pays for what it imports, not for
the package. Minified and gzipped, the stylesheet not counted: an import that
uses nothing 1.1 kB, `Button` 5.2 kB, `Select` 9.4 kB, `DatePicker` 10.4 kB,
everything 50.7 kB. The figures come from bundling an entry that imports from
the built `dist/core.js` with Rollup - the peers external, the stylesheet
resolved to nothing - then minifying with esbuild and gzipping. `check:dist`
holds the first of them under 1.5 kB in every package.

umriss writes no HTML into the document and runs under `require-trusted-types-for 'script'`: the visual suite opens every demo page of every package under that policy, and an HTML sink reached while a page renders fails it.

### Forms

Every field takes `value` or `defaultValue` and reports its finished value through `onValueChange(value)`
(Checkbox and Switch: `checked`, `defaultChecked` and `onCheckedChange(boolean)`). With `name`, a field
posts its value into a `<form>` as a native control would: the Combobox its value, not its label, and
`""` when it is empty. A form's `reset` restores every field. `onChange(event)` stays on Input, Textarea,
Checkbox, Switch and Slider, the fields a library such as `register` reads.

A native form with a React 19 `action` needs no library:

```tsx
<form action={(data) => save(data.get("centre"), data.get("amount"))}>
  <FormField label="Cost centre">
    <Combobox name="centre" options={CENTRES} defaultValue="CC-2200" />
  </FormField>
  <FormField label="Amount">
    <NumberInput name="amount" defaultValue={4860.5} decimals={2} />
  </FormField>
  <Button type="submit">Send</Button>
</form>
```

With react-hook-form, the value fields go through `Controller`, and `Input` through `register`:

```tsx
const { control, register, handleSubmit, formState: { errors } } = useForm<Booking>({
  defaultValues: { name: "", centre: null, amount: null },
});

<form onSubmit={handleSubmit(save)}>
  <FormField label="Name" error={errors.name?.message}>
    <Input {...register("name", { required: "Required" })} />
  </FormField>
  <FormField label="Cost centre">
    <Controller control={control} name="centre" render={({ field }) => (
      <Combobox ref={field.ref} options={CENTRES} value={field.value} onValueChange={field.onChange} />
    )} />
  </FormField>
  <FormField label="Amount">
    <Controller control={control} name="amount" render={({ field }) => (
      <NumberInput ref={field.ref} value={field.value} onValueChange={field.onChange} decimals={2} />
    )} />
  </FormField>
  <Button type="submit">Send</Button>
</form>
```

Empty is `null` for a choice or a number (`""` for text), so the form's defaults say so. The demo's "Post to a form"
example shows what the posted entries look like.

## Styles

**They load themselves.** `dist/core.js` imports its stylesheet, and the
manifest marks CSS as a side effect, so a bundler keeps it. The stylesheet stays
exported as `@umriss-ui/core/styles.css` for setups that link stylesheets by
hand; nobody has to import it.

**On a phone the safe area is honoured.** Under `viewport-fit=cover` the toasts,
a full-window `Modal`, a `Drawer` and the `CommandPalette` keep clear of a notch
and a home indicator, each edge's inset added to its room. Without
`viewport-fit=cover` nothing moves.

**Touch.** Under a finger (a coarse primary pointer) hit areas are at least
24 × 24 px, a field's text is 16 px and behaviours follow the gesture; a `md`
control stays 32 px and a `sm` one 26 px. To make both 44 px under a finger,
the height WCAG 2.5.5 names, opt in with
`import "@umriss-ui/core/touch-scale.css"` (ADR-0079), anywhere in the entry
file: before or after core makes no difference. Buttons, fields, selects, Tabs,
and the table's and alarms' `sm` buttons grow; `xs`, menu rows, calendar days,
checkboxes, switches and radios keep their size and their 24 × 24 px hit areas.

**They touch nothing else** (ADR-0021). No rule selects `html`, `body`, `*` or a
native element of the page, and the only rules on `:root` declare the tokens.
Each component carries what it needs itself: its type, `box-sizing` on its own
elements, a focus ring on what it makes focusable. A caller's content inside
`Stack` or `Grid` keeps the caller's type.

**Other libraries' dialogs, shadow roots and iframes.** A `Popover`, `Menu`,
`Tooltip` and `ContextMenu` opened inside a modal `role="dialog"` with
`aria-modal="true"` (Radix, Headless UI) open inside it, above and clickable,
and Escape closes the topmost layer only. Inside a shadow root the surfaces and
the announcer stay in that root, inside an iframe in the frame's document, and
their listeners bind to the anchor's own document. Two things are yours:

- The stylesheet must be in the root or frame: a `<link rel="stylesheet">` to
  `@umriss-ui/core/styles.css` (or its text in a `<style>`), as the shadow
  root's first child. The tokens inherit through the host; in an iframe copy
  your token overrides too.
- The toast region has no anchor: give the provider a container that stands in
  the root or frame, `<UmrissProvider portalTarget={() => container}>`.

`useCommandPaletteShortcut(onOpen, { target: iframe.contentWindow })` binds the
keys to a frame's window; a "/" typed in a shadow root's input never opens the
palette. On a pinch-zoomed page the panels fit the visual viewport, and the
toasts, `Modal` and `Drawer` stand against it.

**Everything can be overridden.** The library's rules lie in three cascade
layers, `umriss.tokens`, `umriss.base` and `umriss.components`, and CSS written
outside a layer wins over all of them, whatever the order of loading:

A brand is one file to copy and edit. It sets the font, the whole accent and
the charts' palette, each colour with a light and a dark value, so that no part
of the interface stays petrol; the values are an example (indigo), not the
defaults:

```css brand.css
:root {
  --u-font-sans: "Inter", system-ui, sans-serif;

  --u-color-accent: light-dark(#4338ca, #818cf8);
  --u-color-accent-hover: light-dark(#3730a3, #a5b4fc);
  --u-color-accent-subtle: light-dark(#eef0fb, #1e1f3d);
  --u-color-accent-subtle-pressed: light-dark(#dfe2f7, #282a52);
  --u-color-accent-text: light-dark(#4338ca, #a5b4fc);
  --u-color-on-accent: light-dark(#ffffff, #1e1b4b);

  --u-chart-1: light-dark(#4338ca, #818cf8);
  --u-chart-2: light-dark(#db2777, #f472b6);
  --u-chart-3: light-dark(#059669, #34d399);
  --u-chart-4: light-dark(#d97706, #fbbf24);
  --u-chart-5: light-dark(#0891b2, #22d3ee);
  --u-chart-6: light-dark(#7c3aed, #a78bfa);
}
```

A brand may also change the neutrals, the radius, `--u-transform-caps` with
`--u-tracking-caps`, `--u-button-press-scale`, `--u-label-size` and the modal
widths; the Theming page's table lists every token.

**Denser or roomier.** An application sets the type steps, the spaces and the
small control heights. A table and a calculation follow them, and the
provider's `density` chooses regular or compact on top.

**Layered CSS of your own.** The order of the layers decides who wins, so
declare it before anything else is read.

- Tailwind v4: this line as the first CSS the page reads, before
  `@import "tailwindcss"`. Utilities then win over umriss, and Tailwind's
  preflight stays below it.

  ```css
  @layer theme, base, umriss.tokens, umriss.base, umriss.components, components, utilities;
  ```

- A wrapper library: this line as the first statement of its stylesheet,
  with its own layer in place of `acme`. It holds in either load order.

  ```css
  @layer umriss.tokens, umriss.base, umriss.components, acme;
  ```

Unlayered CSS always wins. A classic unlayered reset (Bootstrap and the like) is
not fixed by layer order.

**Light and dark follow the application's `color-scheme`.** Every token with
two values is written `light-dark(<light>, <dark>)`. An application that
switches its mode with a theme library usually sets `color-scheme` already;
one with a switch of its own writes one line, which its native controls need
anyway:

```css
html.dark { color-scheme: dark; }
:root { color-scheme: light dark; } /* or: follow the system */
```

An application that sets nothing stays light. A part of a page can be dark on
its own (`.panel-dark { color-scheme: dark; }`).

A mode set in CSS - an own rule, Bootstrap, DaisyUI - works in every build.
Where a build lowers `light-dark()` (Vite 8 and Next 16 by default), a mode set
only from JavaScript or through a variable - next-themes, MUI, Mantine, an
inline `style` - stays light. Then write one rule such as
`[data-theme="dark"] { color-scheme: dark; }`, or raise the CSS target to the
browser floor: Vite `build: { cssTarget: ["chrome125", "firefox121", "safari17.5"] }`,
Next a `browserslist` in `package.json`
(`"chrome >= 125", "firefox >= 121", "safari >= 17.5"`).

**Fonts are the application's.** The tokens name Geist first and end in the
system fonts; nothing is loaded. Geist is recommended — `@fontsource/geist-sans`
(400, 500, 600) and `@fontsource/geist-mono` (400) — and any other face is one
token away.

**Browsers:** Chrome 125, Firefox 121, Safari 17.5 or newer. `light-dark()` is
older nowhere; an older browser discards the tokens and shows the interface
unstyled. An application checks the floor itself with
`CSS.supports("color", "light-dark(red, red)")`.

## Testing

Tested: Vitest 5 and Jest 30 (with babel-jest), both on jsdom. happy-dom and Jest 29 may work and are
not promised. `check:dist` runs a test of the installed package in a Vitest project and a Jest project
that hold exactly the files below.

**Vitest** needs one line, `server.deps.inline`: Vitest hands a dependency to Node, and Node cannot
import the stylesheet that the package's JavaScript imports (`Unknown file extension ".css"`). Inlined,
Vitest's own pipeline handles it.

```ts vitest.config.ts
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    environment: "jsdom",
    globals: true,
    setupFiles: ["./umriss.setup.js"],
    server: { deps: { inline: [/@umriss-ui/] } },
  },
});
```

**Jest** needs two settings: `moduleNameMapper` maps every stylesheet to an empty module, and
`transformIgnorePatterns` lets babel-jest compile the package, which ships ES modules. Babel's config
must apply to `node_modules`, so it is a root `babel.config.*`, not a `.babelrc`.

```js jest.config.cjs
module.exports = {
  testEnvironment: "jsdom",
  setupFilesAfterEnv: ["<rootDir>/umriss.setup.js"],
  moduleNameMapper: { "\\.css$": "<rootDir>/css-stub.cjs" },
  transformIgnorePatterns: ["/node_modules/(?!(@umriss-ui)/)"],
};
```

```js css-stub.cjs
module.exports = {};
```

```js babel.config.cjs
module.exports = {
  presets: [
    ["@babel/preset-env", { targets: { node: "current" } }],
    ["@babel/preset-react", { runtime: "automatic" }],
  ],
};
```

**Next.js** with `next/jest`: put the umriss packages in `transpilePackages`; the preset stubs the
stylesheets and compiles the packages itself.

**The announcer** (`announce`, the polite live region that speaks for lists and counts) keeps its
region and a 150 ms timer between tests. Call `resetAnnouncer()` from `@umriss-ui/core` in
`afterEach`: it drops a waiting announcement and empties every region.

**The setup file** gives jsdom the five browser APIs that core's components use. It is the same file
for both runners:

```js umriss.setup.js
globalThis.ResizeObserver ??= class {
  observe() {}
  unobserve() {}
  disconnect() {}
};

globalThis.IntersectionObserver ??= class {
  observe() {}
  unobserve() {}
  disconnect() {}
  takeRecords() {
    return [];
  }
};

window.matchMedia ??= (query) => ({
  matches: false,
  media: query,
  onchange: null,
  addEventListener() {},
  removeEventListener() {},
  addListener() {},
  removeListener() {},
  dispatchEvent: () => false,
});

Element.prototype.scrollIntoView ??= function () {};

/* jsdom knows <dialog> but not showModal() and close(). */
HTMLDialogElement.prototype.showModal ??= function () {
  this.setAttribute("open", "");
};
HTMLDialogElement.prototype.close ??= function (value) {
  if (!this.hasAttribute("open")) return;
  this.removeAttribute("open");
  if (value !== undefined) this.returnValue = value;
  this.dispatchEvent(new Event("close"));
};
```

**End-to-end suites.** The motion follows `prefers-reduced-motion`, so a Playwright suite turns it off
with `reducedMotion: 'reduce'` in `use`. A tool without that switch sets, on `:root`, the tokens the
reduced-motion block sets to `0ms`: `--u-transition`, `--u-duration-press`, `--u-duration-fast`,
`--u-duration-medium`, `--u-duration-draw`, `--u-delay-draw`, `--u-duration-exit-fast`,
`--u-duration-exit` and `--u-duration-exit-collapse`.

## Wording

English is the default wording. German ships as well, as the subpath export
`@umriss-ui/core/wording/de`, and an application takes it on purpose:

```tsx
import { UmrissProvider } from "@umriss-ui/core";
import { GERMAN_WORDING } from "@umriss-ui/core/wording/de";

<UmrissProvider language={{ wording: GERMAN_WORDING }}>…</UmrissProvider>;
```

Both objects are typed `Wording`, so a missing entry is a compile error rather
than a gap that shows up in the interface (ADR-0018, ADR-0019). An
`UmrissProvider` without `language`, nested for a toast or a density, keeps the
language around it.

The formats — dates, numbers, durations — are a seam of their own. The default
is English notation on a 24-hour clock (`17/03/2026`, `09:05`, `1,234.5`), and
the same subpath ships `GERMAN_FORMATS` beside the German wording, so a German
application takes both halves of its language in one import (ADR-0024):

```tsx
import { GERMAN_FORMATS, GERMAN_WORDING } from "@umriss-ui/core/wording/de";

<UmrissProvider language={{ wording: GERMAN_WORDING, formats: GERMAN_FORMATS }}>…</UmrissProvider>;
```

### Time zone

Every instant is shown in the reader's time zone. An application whose screen belongs to one place - a
plant in Berlin, read from Chicago - names that zone in the formats, an IANA name:

```tsx
<UmrissProvider language={{ formats: { timeZone: "Europe/Berlin" } }}>…</UmrissProvider>;

// German notation in the zone: spread the set
<UmrissProvider language={{ formats: { ...GERMAN_FORMATS, timeZone: "Europe/Berlin" } }}>…</UmrissProvider>;
```

A switch between the plant's time and the reader's is a provider whose formats name the zone or not;
[the control room scenario](https://github.com/romanhaendler/umriss-ui/blob/main/packages/core/demo/scenarios/05-watch-a-kiln-line.tsx) shows it, with its charts, table and
schedule following:

```tsx
const parent = useLanguage().formats;
const formats = useMemo(() => (plantTime ? { ...parent, timeZone: "Europe/Berlin" } : parent), [parent, plantTime]);
<LanguageProvider formats={formats}>…</LanguageProvider>;
```

`useFormats().timeZone` tells the zone in use. A section in another zone is a nested `LanguageProvider`
that names it; under a language, nest `{ ...useLanguage().formats, timeZone }`, since a bare `{ timeZone }`
merges over the English set and drops the parent's language. A misspelled name throws Intl's `RangeError` where the formats are merged, so a screen never
shows the reader's time while claiming the plant's.

- **What follows the zone:** every date and time the formats write (`date`, `dateShort`, `month`,
  `dateLong`, `time`, `dateTime`, `offset`, `timeZoneName`), so a table's cells, its day groups and its day
  filter. A date entry you replaced stays yours.
- **What stays the reader's:** the language, "now", and ages such as "3 minutes ago".
- **The label:** `useTimeZoneLabel()` returns the zone's generic name (`formats.timeZoneName`) where the
  formats name a zone, the page has hydrated and the reader's own zone is another, and `null` otherwise.
  A table puts it in the head of its time columns.
- **The server:** with a zone named, the server writes every instant, because the zone does not depend
  on the reader; only the label waits for hydration.

## Components

The table is not part of this package. It lives in
**`@umriss-ui/table`**:
`useTable` with columns as elements, `Toolbar`, `Search`, `ColumnMenu`, `Export`,
`Pagination` and `VerdictColumn`. That package takes
`@umriss-ui/core` as a peer and reads its provider, formats and wording.

| Component | Purpose |
| --- | --- |
| `Button` | variants primary/secondary/ghost/plain/danger, sizes, loading state |
| `IconButton` | a square button that shows only an icon; its required `aria-label` is the name and the tooltip |
| `FormField` / `FormFieldBoundary` | label, help text, error; wires `id`/`aria-*` automatically through context. `FormFieldBoundary` resets the context inside panels so that their contents do not inherit the trigger's field id |
| `Textarea` | multi-line input; grows with its content on request (`autoGrow`, `maxRows`), character counter (`showCount`) |
| `RadioGroup` | one out of a few, each option with an optional explanatory line; one tab stop, arrow keys select |
| `SegmentedControl` | one out of a few short options, drawn inset - a sunken track, the choice lifted out of it - or as a `field`; `fill` shares its place equally, an option takes an `icon`; a radio group to the keys and the screen reader |
| `Alert` | a message that stays; five tones, actions, closable on request – the role follows the tone |
| `Tag` / `TagGroup` | a removable label; one tab stop and arrow-key navigation within the group |
| `Divider` | a dividing line beside Stack and Grid: horizontal/vertical, two weights, optionally with a label |
| `VisuallyHidden` | text for the screen reader only; `focusable` turns it into a skip link |
| `ButtonGroup` / `SplitButton` | connected buttons; a main action plus variants through the existing menu |
| `Text` / `Heading` / `Link` | typography on the token scale; for `Heading`, level and size are independent; `Link` (and `Breadcrumb`) drop an `href` that is not `http:`, `https:`, `mailto:`, `tel:` or relative - `javascript:`, `vbscript:` and `data:` do nothing, with a DEV warning |
| `Input` / `Select` / `Checkbox` | form elements; `Input numeric` in Geist Mono, `Input clearable` with a softly fading-in × button (clears without losing focus); `Select` a native `<select>` that opens the Combobox's list under a mouse and the keys and the system's picker under a finger (ADR-0043); `Checkbox indeterminate`; every field fills its place or is its natural width, never what it shows, and takes `chars` for a width in characters (ADR-0041) |
| `Modal` / `ModalHeader` / `ModalBody` / `ModalFooter` | dialogs built on `<dialog>`; free space is distributed in the golden ratio (38 : 62) above and below the surface – small modals sit in the upper third, long ones use the full height, and only the body scrolls while head and foot stay put |
| `ConfirmDialog` | a compact confirmation dialog, `tone="danger"` for destructive actions, loading state |
| `ToastProvider` / `useToast` | passing messages as a deck at one of six places: four tones and `loading`, one action, `update` in place, a close reason, a limit, Alt+T, `aria-live` |
| `Menu` / `MenuItem` / `MenuSeparator` | a dropdown menu with a portal panel, arrow-key navigation, `tone="danger"` |
| `ContextMenu` | the same menu opened at a point in the viewport - for a right-click on a surface that is not a button; controlled, focus returns to where it was |
| `Tooltip` | help text on hover and keyboard focus, inverted (ink surface), portal |
| `Tabs` / `TabList` / `Tab` / `TabPanel` | controlled tabs with an ink underline and arrow-key control |
| `Skeleton` | a loading placeholder (bar or circle) with a discreet pulse |
| `EmptyState` | an empty state with title, description, action and an optional symbol |
| `Stack` / `Grid` | layout primitives with token spacing (a 4 px step), `Grid` with a fixed count, a width per column (`columns={[140, "fill"]}`) or responsive via `minItemWidth` |
| `ColorPicker` | colour field: a swatch and the hex value; a panel with a saturation and brightness square, a hue strip, hex and R, G, B fields, an eyedropper, the application's own swatches, the contrast against light and dark surfaces, the colour beside the one it opened with, Cancel and Done |
| `DatePicker` | calendar selection: weeks from Monday, arrow keys across the month, today/clear, the date in Geist Mono |
| `DateTimePicker` | date plus time: two-digit fields that advance automatically, visible up/down steppers and arrow-key counting; after the day is chosen the focus jumps into the time, `withSeconds`, "now"; the clock change is handled honestly – a missing hour (the start of summer time) is detected and corrected forwards with a note, a duplicated hour (the start of winter time) offers the choice between both occurrences including the UTC offset |
| `TimeInput` | a time of day without a day: the date-time picker's hour, minute and (`withSeconds`) second fields standing alone - they type themselves onwards, arrows count round the clock, a pasted `14:30` is split; the value is the text `HH:mm` (`HH:mm:ss`), `null` while empty, and the same text is posted |
| `Combobox` | a searchable select field (listbox panel, arrow keys, `aria-activedescendant`), optionally `clearable`; `Input`'s two sizes |
| `MultiSelect` | multiple selection: the field always stays on one line and measures the space (as many chips as fit, the rest as "+N"); chips are remove buttons (hover shows ×, a click deletes, backspace deletes the last, roving tabindex with arrow keys), and the "+N" counter opens the selected view directly; a panel with a search field (autofocus, Enter toggles the first hit), a view switch "all \| selected (N)" (the list always in natural order, deselected rows stay visible in the selected view until the view changes), and all/none/invert acting on the filtered set of the active view; optionally `clearable`, a × that empties what "none" would, its room kept in the field's width; `Input`'s two sizes |
| `Card` / `CardHeader` / `CardBody` | panels with an eyebrow, actions, optionally collapsible; `flush` for borderless tables; a dividing line under the head only through `divider` (for borderless data) – otherwise white space carries the hierarchy |
| `Avatar` | a round mark for a person or a team: a picture (initials when it fails), or initials derived from the name; `sm` for a cell, `md` for a lane's header |
| `Badge` | a status label with a dot, five tones; slightly rounded by default, `pill` for counters |
| `NumberInput` | numeric input in the notation the formats seam provides (group separators on leaving the field; it reads back what it writes, whatever the notation), `decimals` (0 = whole numbers), `min`/`max`, arrow keys with Shift ×10, an integrated spinner column at the right inner edge, `prefix`/`suffix` adornments (€, %); it asks for the text keyboard while a negative value is allowed, so `min={0}` keeps the number pad on a phone |
| `Meter` | a narrow fill bar (0–1) with a mono percentage label, five tones – for utilisation in cells; `label` names what is being measured |
| `ControlSizeProvider` | one size for the controls in a place - a toolbar, a dense form: every control with `size` inside takes it unless it says its own. A popover, dialog or tooltip opened from there starts without it |
| `UmrissProvider` | one place to set things: density, portal target, toasts, language. **Optional** – without it everything behaves as it does unconfigured. It holds no theme (light and dark are the application's `color-scheme`) and writes nothing onto the document |
| `LanguageProvider` / `useFormats` / `useWording` | formatting and wording as an overridable seam; the wording is a directory of entries, not a translation call. English is the default, German ships as `@umriss-ui/core/wording/de` |
| `DateRangePicker` | a period in two clicks across two chained months: backwards is allowed (the ends swap silently), a preview band on hovering, quick choices from the wording; on a phone the months stand one below the other |
| `DateTimeRangePicker` | a period with a time at both ends: "all day" as the default, time fields that advance, Enter accepts; the clock change is handled per end |
| `Popover` | the one closable, anchored surface underneath Menu, Combobox and the pickers: portal (nearest `<dialog>`, then the portal target, then the body), position with flipping above and below and across its trigger's edges, a panel that fits nowhere cut to the larger side instead of laid over its trigger, clamping as the last resort, never larger than the window (it scrolls in itself beyond that), outside click, Escape with focus returned |
| `TreeView` / `TreeSearch` / `useTree` | a tree with exactly one active node and optional ticking (cascade, indeterminate, locked, unloaded); arrow keys, type to jump, range selection, virtualisation. The search keeps its term in the tree |
| `Stat` | a metric: one value, read against its limits – the verdict as a word and a colour, the deviation from the target value, history, freshness and the source's quality |
| `CommandPalette` / `useCommandPaletteShortcut` | a command palette: subsequence search with rank and highlighted finds, groups, keywords a candidate is found by, at most `maxFinds` finds with a line for the rest, a populated resting state; opens on Ctrl/⌘+K and `/` (`slash: false` switches the single key off, WCAG 2.1.4; neither opens inside a modal dialog) |
| `CrossGlyph` / `PlusGlyph` / `MinusGlyph` / `AngleGlyph` / `EndGlyph` / `CalendarGlyph` / `ClockGlyph` / `DropperGlyph` / `GripGlyph` / `GridGlyph` / `MeasureGlyph`  / `MoreGlyph` / `ToneGlyph` | the shared character set, one stroke width at one nominal size; specification in `docs/glyphs.md` |
| `Sparkline` | a miniature history line with an area gradient and an accent end point – for trends in cells |
| `Spinner` | a functional loading indicator |
| `Switch` | on or off, taking effect at once: a native checkbox under `role="switch"`, the label beside it, two sizes, invalid through `FormField`; the thumb travels on the path transition |
| `Slider` | one value between two bounds on the native range input, drawn with tokens: `min`/`max`/`step`, marks with optional words, `format` for the mono readout and `aria-valuetext`; arrows, PageUp/PageDown by a tenth, Home/End - the same on every engine |
| `RangeSlider` | a lower and an upper end on one track, two native range inputs over one drawn groove: `[from, to]` through `value`/`defaultValue`/`onValueChange`, on the step grid from `min`, the ends never cross; each thumb a slider of its own, posted as `<name>Start`/`<name>End`; a press on the bare track moves the nearer thumb |
| `Drawer` | the `Modal`'s dialog entering from an edge (`side="right" \| "left"`): focus trap, Escape and focus return from the browser, `ModalHeader`/`ModalBody`/`ModalFooter` inside, its width the token `--u-drawer-width`; modal only |
| `ProgressBar` | how far a task has come (`role="progressbar"`), determinate from 0 to 1 or indeterminate without a value; `valueText` for a count; no tone, because progress is no verdict - that is the `Meter` |
| `Accordion` / `AccordionItem` | sections behind headers that are buttons with `aria-expanded`: `type="single" \| "multiple"`, controlled or uncontrolled, arrow keys between the headers; the height animates as the card's collapse does |
| `Breadcrumb` | where a page stands: `<nav>` with an ordered list, the last item `aria-current="page"`, items as links or buttons (routing is the caller's); when narrow the middle levels fold into a `Menu`, measured rather than guessed |
| `Splitter` | two panes and the line between them (the APG window splitter): side by side or stacked, the first pane's share in per cent, controlled or uncontrolled, `min`/`max`; drag, the arrows of its axis, Home/End, Enter collapses and restores |
| `Stepper` | where a procedure stands: an ordered list of steps, done, current (`aria-current="step"`), upcoming or failed - each said as a word beside its label and drawn as a number, tick or cross; in a row or a column; moving on is the caller's |
| `FileInput` | the native file input behind a key, inside a zone that takes a drop: `accept` and `multiple` hold for the drop as for the dialog, the chosen files listed with their size and a cross each, controlled or uncontrolled, invalid through `FormField`; no upload |

## Principles for new components

1. Every component has one of four shapes (ADR-0068), and `ref` is always an
   element - never a handle. The other packages follow the same contract.
   - **An element**: `ref`, `className`, `style` and the rest reach the root
     element. Most of core: `Button`, `Card`, `Stack`, `Stat`, `TreeView` (its
     `role="tree"` list), the `<dialog>` of `Modal`, `Drawer`, `ConfirmDialog`
     and `CommandPalette`, and the rest that render a root.
   - **A field**: the class and the style reach the wrapper, which a caller
     dresses and sizes (ADR-0041); `ref` and the rest reach the control that
     takes the focus. In core: `Checkbox`, `Switch`, `Slider`, `NumberInput`,
     `Select`, `FileInput`, `Input`, `Textarea` and `TreeSearch` (the native
     control), `Combobox` (its input), and `MultiSelect`, `DatePicker`,
     `DateTimePicker`, `DateRangePicker` and `DateTimeRangePicker` (the trigger
     button). So `data-testid` on a `Combobox` finds the input, and a
     `<label htmlFor>` names a picker. `SplitButton` keeps its class on the
     group and its style and rest on the main action.
   - **A composite** - a frame that holds several parts, with the name routed to
     the part that carries the role: core has none; the table, the chart, the
     schedule and the calculation are the ones.
   - **No element of its own**, each with its reason: `Popover` renders into a
     portal, `Tooltip` wraps the caller's child, `Menu` and `ContextMenu` are
     composed of other parts, `ToastProvider` is a context with a portal, and the
     providers render no element at all.

   The component's own `role`, the `aria-*` it computes and its handlers are not
   replaced by `rest`: a caller's handler runs first and can `preventDefault`.
   Held by `tests-unit/passthrough.test.tsx`, which renders every export.
2. Support controlled **and** uncontrolled use (`value`/`defaultValue`), with
   the callback named for the state (`onValueChange`, `onCheckedChange`; ADR-0081).
   Every field does both. `Modal`, `Drawer` and `CommandPalette` are controlled
   only, because opening is the caller's decision.
3. Keyboard operation and `aria` attributes are part of the definition of done.
4. No business logic: a mapping such as "status X is green" is the application's
   to make.
5. Tokens only, no raw values. A new value is created as a token first. No
   selector reaches beyond the component's own elements, and every rule lies in
   a layer (ADR-0021; the guards in `tests-unit/stylesheets.test.ts` hold it).
6. Everything is English – identifiers, props and prose (ADR-0018, which
   reversed ADR-0015). The accessible name is spelled `aria-label` everywhere
   (ADR-0068). It is required where a component shows no text of its own
   (`IconButton`, `TagGroup`, `TreeView`) and optional where it names a group
   or a surface (`ButtonGroup`, `ContextMenu`, `Popover`); `Menu` and
   `Breadcrumb` take it through the rest of their props.
   `size` is `"sm" | "md"` on a control (`Avatar` has a scale of its own,
   `Modal` is `"sm" | "md" | "lg"`), a `TextSize` on `Text`, `Heading` and
   `Link`, and a number of pixels on a glyph and the `Spinner`.
7. A field's root composes `extent` from `#own-styles`: it fills the place
   that gives it a width, is its natural width where the place asks, and is
   never wider than its place; what it shows never moves it (ADR-0041). A field
   that shows text takes `chars` and sets its chrome; every control with two
   heights takes `size` and reads it through `useControlSize`, so a
   `ControlSizeProvider` reaches it, and a surface of its own resets it.
   Held by `tests-unit/controlSize.test.tsx` and
   `tests-visual/features-sizes.spec.ts`. Two exceptions, by design: the
   `SegmentedControl` stands among fields but shows no value, so it is as
   wide as its words (`fit-content`) and fills a place only when told to
   (`fill`); and the `Checkbox`
   has one look and no `size` - in a field it reads the place's size only
   for the height of the row it stands in (field-row-alignment).

## Roadmap

The core scope is complete, and so are the command palette, the
danger text tone, the pass-through of rules 1 and 2 above, the six basic
components and the layout extras, forced colours, the listbox
announcements, the fields' widths and sizes (ADR-0041), the four shapes of a
root (ADR-0068), the targets under a finger (ADR-0070), long option lists, a date
that can be typed and bounded, and a source's quality (ADR-0077).

What core will not build at all stands in
[ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0032-what-umriss-is-not.md). Validation is the
caller's, and umriss shows the reader's time unless the application names a zone
([ADR-0076](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0076-an-application-names-the-time-zone-its-instants-are-shown-in.md)); a dashboard
a user arranges is its own package, `@umriss-ui/dashboard`
([ADR-0064](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0064-a-dashboard-a-user-arranges-is-a-sequence-on-fixed-columns.md)).

A skip link belongs to an application's page frame and core has no frame, so the application provides it (`VisuallyHidden` with `focusable` is the piece to build it from).
