# Writing a Sepale family

You are writing a **family** for Sepale: one CSS file that styles every
component of the kit in one visual direction, tuned through **parameters** a
theme sets. The components already exist: their DOM and their classes are
fixed. Your file paints them. Nothing you write changes the markup.

This document is self-contained and written for an AI assistant. It holds the
steps, the **contract** the file must meet, and links to one page per
component. Links are relative to this file's address.

- Every component in one file, for an upload: [full.md](full.md)
- The page that loads your file and reports on it: [Create a family](../new-family), in the app

## Steps

### 1. Agree the direction

Ask the user, in one message, for:

- the **name**: one lowercase word (the built families are flowers: daisy,
  dahlia, sunflower, cosmos, peony);
- the **direction**: what the look is, in a sentence or two, and the design
  system or site it follows, if any;
- the **parameters** they want to tune: colours at least, then the family's own
  knobs (radius, border width, shadow depth, blur…);
- the **light/dark** stance: both themes, or one.

Done when the user has confirmed a name and a direction. Write the direction
into the header comment (see *The file*), it is the brief for every step after.

### 2. Write the root

The header comment, the `uu-params` declaration, the defaults on
`:where(:root)`, then everything outside a component: the type scale,
`--scale`, the colours the family derives (inks written on each colour), the
recipes on `:where(*)`.

Done when the file loads on the app's page and the report shows the
parameters, with no error.

### 3. Style the components, one page at a time

Work through the [component index](#components) in its order: form controls
lean on buttons and inputs, layouts lean on everything. For each page:

1. Read its page here. It lists the component's classes (root, parts, axes,
   flags), the states the built families draw, the custom properties the
   component writes for you to read, and the DOM it renders.
2. Read the reference SCSS it links, for the **mechanism**: how the built
   families lay the component out, position its indicator, draw its fill. Its
   `structure` mixin is the mechanism to keep; its `look` mixin is the part you
   rewrite in your direction.
3. Write the component's rules.

Done for a page when every class it lists is styled or deliberately left out,
and every listed state has a visible answer: hover, focus-visible, disabled,
checked, open, current. Done for the step when the app's report lists no
missing component you meant to style.

### 4. Hand over and iterate

Give the user the whole file, every time: the app loads a file, not a patch.
They load it on the app's page (loading a file under the same name replaces the
family) and walk the component pages in a light and a dark theme.

Hand over the stylesheet only. Do NOT write a `.d.ts`, a type declaration or a
list of variants for it. The family works without one: the classes draw
everything. Its types — `name.css.d.ts`, which narrows the Svelte components'
props to what the family draws — are optional and DERIVED from the stylesheet:
the app's "Create a family" page offers them once the family is loaded
("Download types", or the bundle), and `npx sepale-types name.css` writes them
without the app. A declaration written by hand can promise a variant the
stylesheet does not draw; the derived one cannot. If the user asks for types,
point them to those, and tell them to regenerate after every change.

Each round, the user names what is wrong: a component, a state, a theme. Answer
with the smallest change that fixes it, in that component's rules only, and
say which rules you changed. When the report shows a class no component
classifies, rename or remove it before anything else: such a class is a typo or
an invention, and the build of a real family rejects it.

## The contract

### The file

One stylesheet, plain CSS, UTF-8, self-contained: no `@import`, and no `url()`
to another site. The app previews a family with everything remote blocked (its
security policy), so a remote font or image shows as missing there. Name a web
font in a parameter's value (`"Inter", system-ui, sans-serif`) and let the page
that uses the family load it; an icon or a texture goes inline, as a `data:`
URL.

It opens with a header comment, which the app reads for the family's name and
prose. Keep its shape:

```css
/* ============================================================
   STYLE FAMILY — « orchid »  (after Some Design System)

   One or two paragraphs: what the look is, what it follows.

   Changes made to fit our contract:
     - Each place where the source design had to be read rather
       than copied, one bullet each.
   ============================================================ */
```

The `(after …)` part is the short label the family picker shows. The
"Changes made" list is optional.

### Parameters

A parameter is a custom property a theme sets. Declare each one twice: its
default on `:where(:root)` (zero specificity, so any theme wins), and its
description in one `uu-params` comment, a JSON array on a single line, which the
theme editor reads:

```css
:where(:root) {
	--color-surface-1: #ffffff;
	--color-primary: #4f46e5;
	--radius-field: 0.5rem;
}

/*! uu-params [{"name":"color-surface-1","label":"Surface 1","group":"Colors","type":"color","value":"#ffffff","kind":"surface","on":"color-on-surface"},{"name":"color-primary","label":"Primary","group":"Colors","type":"color","value":"#4f46e5","kind":"accent","on":"color-on-primary"},{"name":"radius-field","label":"Field radius","group":"Shape","type":"length","value":"0.5rem","min":0,"max":2,"step":0.05,"unit":"rem","units":["px","rem","em"],"description":"Corner radius of buttons, inputs and selects."}] */
```

Fields: `name` (without `--`), `label`, `group`, `type`, `value` (the default),
and optionally `description`, `min` / `max` / `step` (a slider), `unit` and
`units` (a unit picker). `type` is one of:

- `color`;
- `length`, `number`;
- `edge-width`: a `border-width` shorthand, edited as a width and four edge
  toggles (`"1px 0 1px 0"` draws top and bottom);
- `shadows`: a whole `box-shadow` value, edited as layers.

A colour also carries `kind`, which is `surface` (a ground things rest on),
`accent` (a colour things are painted with) or `ink` (text and lines over both),
and `on`, the variable holding the ink written on it. Groups the editor orders
first: `Colors`, `Typography`, `Shape`, `Size`, `Effects`, `Elevation`.

The parameter set is the family's own: five surfaces or one, fifteen knobs or
none. The names the built families share (and that the colour axes expect) are
`--color-surface-1` … `-3`, `--color-border`, `--color-on-surface`, and the
eight accents `--color-primary`, `secondary`, `accent`, `neutral`, `info`,
`success`, `warning`, `error`, each with its ink `--color-on-<accent>`. An ink
may be a parameter or derived by the family in its root rules
(`color-mix`, `oklch`): derived inks make every theme legible.

A theme is a `:root { … }` block of parameter values and a `color-scheme`. The
family reads only its parameters, so a dark theme is a set of dark values, and
the same rules draw it.

### Sizing

Every component is **intrinsic**: its lengths are `em`, resolved against its
own font size, so a component grows with its text and needs no breakpoint.

- A **size** axis value only sets `--fontsize`. The type scale is fixed, ratio
  1.125 on `1rem`; declare it in the root as `--default-xxs` … `--default-xxxl`
  (`0.7023rem`, `0.7901rem`, `0.8889rem`, `1rem`, `1.125rem`, `1.2656rem`,
  `1.4238rem`, `1.6018rem`, `1.802rem`) and write
  `.btn-lg { --fontsize: var(--lg, var(--default-lg)); }`. The component reads
  `font-size: var(--fontsize, var(--default-base))`.
- **`--scale`** (default `1`, on `:where(:root)`) grows the frame and never the
  text: write each height, padding and gap as `calc(Nem * var(--scale))`. Text,
  icons, radii and hairlines stay out of it.
- Inline SVG sits on the text: `svg { height: 1em; }`.
- The root font size is the page's. The family leaves it alone.

### Slots and recipes

- **Fill slots.** A component's base rule paints from its own custom
  properties (`background-color: var(--btn-bg)`, `color: var(--btn-fg)`), and
  every variant sets those properties. Variants then compose, and integrations
  keep working: `join` rounds the outer corners of its children through
  `--join-ss`, `--join-se`, `--join-es`, `--join-ee`, which a field or a button
  reads as `border-start-start-radius: var(--join-ss, var(--radius-field))`.
- **Give every `var()` a value.** A `var()` that resolves to nothing voids the
  whole declaration: `border: var(--border) solid red` with `--border` unset
  draws no border at all.
- **Recipes on `:where(*)`.** A formula built from other custom properties (a
  shadow from a depth, a relief from an offset) is declared on `:where(*)`, so
  it resolves on each element and recomputes when a state changes one input. On
  `:root` it would resolve once, for the whole page.
- **Write class names whole** in selectors (`.btn-primary`), never assembled.

### Classes and states

- Write the classes the component pages list, under their namespaces: `btn`
  owns `.btn` and every `.btn-*`. A class outside every list is one no
  component writes, and the app reports it.
- A family may ship part of an axis (four colours instead of eight) or leave a
  component out: the components then offer only what the family ships, and the
  app reports what is missing. Ship whole components rather than half of one.
- Reach into another component where the two meet (`join` sets `.btn`'s
  corners, `validator` colours a field): that is integration, and it lives in
  the file of the component doing the reaching.
- Draw the **states** each page lists: they are how the DOM says what it is
  (`[aria-selected=true]`, `[data-state=peek]`, `:checked`, `[open]`). Draw
  `:focus-visible` on everything focusable.
- Read the **custom properties the component writes**, listed on each page:
  the tab indicator's position (`--tabs-x` …), a range's fill (`--range-pct`),
  a one-off fill set by the `background` prop (`--<namespace>-bg`).

### Motion

- **What moves on a change of state is the family's**: CSS transitions and
  keyframes on its classes and states. A menu folding, a knob sliding, the tab
  indicator following `--tabs-x`: the component sets a state or a custom
  property, the family decides how it travels.
- **No component animates by itself** (ADR 0019). When an element comes,
  goes or changes places, the component marks the moment on it and waits as
  long as the family's CSS says, read back from the computed style:
  - `data-motion="enter"`: just inserted, while your animation runs. A new
    element has no style to transition from: use `@keyframes` (or
    `@starting-style`).
  - `data-motion="leave"`: going; it stays in the DOM until your transitions
    and animations on it have run (a dialog's box, a dropdown, a dismissed
    alert, a toast).
  - `data-motion="move"`: changed places in a list (the toast stack);
    `--motion-dx` / `--motion-dy` hold where it came from.
  - `--motion-w` / `--motion-h`: its size as it enters or leaves, for a
    height that folds (`height: auto` does not animate).
  Draw nothing for a phase and it is instant. Each page's *Motion* section
  names the elements marked.
- **Some wait for a change of state**: a drawer closes its `<dialog>` once its
  hidden state's transition has run; a ripple wave is removed once its
  animation has.
- Wrap what is decorative in `@media (prefers-reduced-motion: no-preference)`,
  or cut it under `reduce`.

### Browser support

Target at least 90% of browsers in use: `color-mix`, `oklch`, `:has()`,
`:where()`, container queries and `@layer` qualify. Give anything newer a
fallback declared before it.

## Reference

The five built families, as SCSS, one file per component:
`reference/<family>/<page>.scss`, where `<family>` is `daisy` (after DaisyUI),
`dahlia` (after Radix), `sunflower` (neo-brutalist), `cosmos` (hand-drawn) or
`peony` (soft dashboard). Each family's `reference/<family>/index.scss` holds its
parameters and include order, `reference/<family>/_root.scss` its page layer.
The Sass helpers they call are in `reference/_mixins.scss`, `_config.scss`
(the axis lists) and `_params.scss` (the `uu-params` emitter). Each file has a
`structure` mixin (the mechanism) and a `look` mixin (the values): read them for
how a component works, then write your own CSS.

## Components

### Actions

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Button](button.md) | `btn` | `<Button>` | The thing you press. |
| [Link](link.md) | `link` | — | Text that goes somewhere. |
| [Join](join.md) | `join` | `<Join>` | Glue two or more controls into one object: the inner corners go square, the outer ones keep the family's radius. |

### Form

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Input](input.md) | `input` | `<Input>` | A single-line field. |
| [Textarea](textarea.md) | `textarea` | `<Textarea>` | A multi-line field. |
| [Select](select.md) | `select` | `<Select>` | A closed list of choices, drawn as a field so it lines up with the inputs beside it. |
| [Combobox](combobox.md) | `combobox` | `<Combobox>` | A field whose value is looked up in a list while typing. |
| [Number input](number-input.md) | `number-input` | `<NumberInput>` | A number field, its figure aligned to the end like a number in a column. |
| [Date picker](date-picker.md) | none | — | A field that opens a calendar: an Input, a Dropdown and an inline Calendar put together. |
| [Calendar](calendar.md) | `calendar` | `<Calendar>` | A date picker, drawn by air-datepicker (vendored, MIT). |
| [Color picker](color-picker.md) | `color-picker` | `<ColorPicker>` | One colour, edited in OKLCH: lightness, chroma and hue, each a slider whose track is the gradient it moves along, plus the raw value for anything the sliders cannot say. |
| [File input](file-input.md) | `file-input` | `<FileInput>` | The browser's file picker wearing the kit's field frame. |
| [File dropzone](file-dropzone.md) | none | — | Its content becomes a place to drop files on. |
| [Checkbox](checkbox.md) | `checkbox` | `<Checkbox>` | An independent yes/no. |
| [Radio](radio.md) | `radio` | `<Radio>` | One choice out of several. |
| [Toggle](toggle.md) | `toggle` | `<Toggle>` | A switch that takes effect immediately, unlike a checkbox that waits for a submit. |
| [Switch](switch.md) | `switch` | `<Switch>` | One choice among a few, as a pill track. |
| [Range](range.md) | `range` | `<Range>` | A value picked along a track, where the approximate position matters more than the number. |
| [Rating](rating.md) | `rating` | `<Rating>` | A whole-number score picked from a row of icons. |
| [Chips input](chips-input.md) | `chips-input` | `<ChipsInput>` | An accumulator: several values, each a chip, collected from a field. |
| [Editable](editable.md) | `editable` | `<Editable>` | A value shown as it is, that turns into its editor when asked: a click, Enter or F2. |

### Form layout

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Label](label.md) | `label` | `<Label>` | Inline text naming a control — on its own, or inside a field as a prefix or a suffix (.input > .label). |
| [Floating label](floating-label.md) | `floating-label` | `<FloatingLabel>` | A container that wraps a field: its <span> sits over the frame and rises out of the way once the field has content. |
| [Fieldset](fieldset.md) | `fieldset` | `<Fieldset>` | A group of related fields with a legend. |
| [Validator](validator.md) | `validator` | — | Marks a field as validated: the field paints itself from its own :valid / :invalid state, and the hint appears only when it is wrong. |

### Display

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Text](text.md) | `text` `title` `subtitle` | `<Subtitle>` `<Text>` `<Title>` | The typographic scale, delivered as classes — no frame, no state. |
| [Avatar](avatar.md) | `avatar` | `<Avatar>` | A picture, or a few letters, standing for someone — cropped to a shape. |
| [Badge](badge.md) | `badge` | `<Badge>` | A count or a mark pinned to another element. |
| [Chip](chip.md) | `chip` | `<Chip>` | A small standalone token: a status, a tag, a removable value. |
| [Swatch](swatch.md) | `swatch` | `<Swatch>` | A sample of one colour, passed in as --swatch-color. |
| [Bubble](bubble.md) | `bubble` | `<Bubble>` | A chat message: one class on one block, which gives it a fill, an ink and a tail at the bottom of one side. |
| [Card](card.md) | `card` | `<Card>` | A box with, optionally, a figure, a title, a body and a row of actions. |
| [Stat](stat.md) | `stat` `stats` | `<Stat>` `<Stats>` | A figure worth a glance — a title, a value, a description, and optionally a figure on the side and actions. |
| [Carousel](carousel.md) | `carousel` | `<Carousel>` | A row of items that scrolls and snaps natively, with optional arrows over it, upcoming items and a pagination under it. |

### Feedback

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Alert](alert.md) | `alert` | `<Alert>` | An inline message — information, success, warning, error — where it concerns the user. |
| [Toast](toast.md) | `toast` | `<Toast>` | A stack of alerts that pile up, each leaving on its own. |
| [Loading](loading.md) | `loading` | `<Loading>` | Work is in progress and there is no percentage to show. |
| [Progress](progress.md) | `progress` | `<Progress>` | How far along something is, on a line. |
| [Radial progress](radial-progress.md) | `radial-progress` | `<RadialProgress>` | The same statement as progress, drawn as a ring, for when the number itself is the point. |
| [Skeleton](skeleton.md) | `skeleton` | `<Skeleton>` | The shape of content that has not arrived. |
| [Empty state](empty-state.md) | `empty-state` | `<EmptyState>` | What to show when there is nothing: no results, an empty folder, a list not started yet. |

### Data

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Data handler](data-handler.md) | none | — | The live state of one remote resource — the current page of rows, the total, the search, the sort, the filters, the selection, the unsaved edits and their history — and the requests that read and change it. |
| [Data control](data-control.md) | `data-control` | `<DataControl>` | The controls of a data handler, around the view that shows its rows: filters, sort, search, page size, pagination, and actions on the selection or on the whole resource. |
| [Table](table.md) | `table` | `<Table>` | A real <table>. |
| [Grid](grid.md) | `grid` | `<Grid>` | Items in as many columns as fit. |
| [List](list.md) | `list` | `<List>` | Rows of data in a painted box. |
| [Kanban](kanban.md) | `kanban` | `<Kanban>` | Items in columns, one column per state they can be in. |
| [File explorer](file-explorer.md) | `file-explorer` | `<FileExplorer>` | Files and folders in a hierarchy, Drive-like: the folder tree, the current folder as a list or a grid, the details of the selection, under a toolbar with the path and your actions. |

### Navigation

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Menu](menu.md) | `menu` | `<Menu>` | Navigation with one current item, optional section titles and optional nested groups. |
| [Tabs](tabs.md) | `tabs` | `<Tabs>` | Switching which panel is visible. |
| [Breadcrumbs](breadcrumbs.md) | `breadcrumbs` | `<Breadcrumbs>` | Where you are in a hierarchy, and the way back up. |
| [Steps](steps.md) | `steps` | `<Steps>` | Where the user is in a journey: one column per step, one bar per sub-step. |
| [Pagination](pagination.md) | `pagination` | `<Pagination>` | A row of pages to jump between, with previous / next. |
| [Dock](dock.md) | `dock` | `<Dock>` | A bar pinned to the bottom edge, for the two to five places you go most. |

### Layout

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Navbar](navbar.md) | `navbar` | `<Navbar>` | A bar across the top. |
| [Sidebar](sidebar.md) | `sidebar` | `<Sidebar>` | An app's side column — a brand, a menu, an account — that folds to a rail. |
| [Drawer](drawer.md) | `drawer` | `<Drawer>` | A panel sliding in from any side, in three states: hidden, peek (its last --drawer-peek in view) and open (all --drawer-size of it). |
| [Footer](footer.md) | `footer` | `<Footer>` | The closing block of a page: columns of links that fill the width as room allows, then a bottom row. |
| [Hero](hero.md) | `hero` | `<Hero>` | The large opening block of a page: a title, a sentence, a call to action, and optionally media beside them. |
| [Divider](divider.md) | `divider` | `<Divider>` | A rule between two things, horizontal or vertical, optionally carrying a word or two. |
| [Collapse](collapse.md) | `collapse` | `<Collapse>` | A panel that folds under its trigger. |
| [Accordion](accordion.md) | `accordion` | `<Accordion>` | A stack of Collapses, joined at their edges. |

### Overlay

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Dialog](dialog.md) | `dialog` | `<Dialog>` | A box laid over the page, built on the native <dialog>. |
| [Dropdown](dropdown.md) | `dropdown` | `<Dropdown>` | A trigger and a box that floats next to it — a menu, a filter, a small form. |
| [Tooltip](tooltip.md) | `tooltip` | `<Tooltip>` | A short hint beside its trigger, shown on hover and on keyboard focus. |

### Mockups

| Page | Namespaces | Svelte | What it is |
| --- | --- | --- | --- |
| [Mobile frame](mobile-frame.md) | `mobile-frame` | `<MobileFrame>` | A phone drawn around content, for showcases and screenshots — not an emulator. |
| [Window frame](window-frame.md) | `window-frame` | `<WindowFrame>` | An application window drawn around content: a title bar with three controls, a title and actions, above a body that scrolls. |
| [Laptop frame](laptop-frame.md) | `laptop-frame` | `<LaptopFrame>` | A laptop drawn around content: a lid holding a 16:10 screen that scrolls, on a wider base. |


---

# Button

The thing you press. Sized from its own font-size, so a button in a larger context grows without a breakpoint.

- Group: Actions
- Namespaces: `btn`
- Svelte: `<Button>`
- Reference SCSS: [cosmos](reference/cosmos/button.scss), [dahlia](reference/dahlia/button.scss), [daisy](reference/daisy/button.scss), [peony](reference/peony/button.scss), [sunflower](reference/sunflower/button.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.btn` | root | all | The component itself. |
| `.btn-disabled` | part | all | For an <a>, which cannot carry the disabled attribute. |
| `.btn-ripple` | part | all | Arm the press wave; the wave itself is drawn by the component. |
| `.btn-ripple-wave` | part | all | One wave, positioned at the press point and removed once the family's motion on it has run (at once if it draws none). |
| `.btn-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.btn-block` | axis width | all | Full width of its container. |
| `.btn-circle` | axis shape | all | Sets shape to “circle”. |
| `.btn-classic` | axis variant | dahlia, peony | Sets variant to “classic”. |
| `.btn-dash` | axis variant | all | Sets variant to “dash”. |
| `.btn-error` | axis color | all | Sets color to “error”. |
| `.btn-ghost` | axis variant | all | Sets variant to “ghost”. |
| `.btn-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.btn-lg` | axis size | all | Sets size to “lg”. |
| `.btn-link` | axis variant | all | Sets variant to “link”. |
| `.btn-md` | axis size | all | Sets size to “md”. |
| `.btn-neutral` | axis color | all | Sets color to “neutral”. |
| `.btn-noshadow` | axis shadow | sunflower | Sets shadow to “none”. |
| `.btn-outline` | axis variant | all | Sets variant to “outline”. |
| `.btn-primary` | axis color | all | Sets color to “primary”. |
| `.btn-reverse` | axis shadow | sunflower | Sets shadow to “reverse”. |
| `.btn-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.btn-sm` | axis size | all | Sets size to “sm”. |
| `.btn-soft` | axis variant | all | Sets variant to “soft”. |
| `.btn-square` | axis shape | all | Sets shape to “square”. |
| `.btn-success` | axis color | all | Sets color to “success”. |
| `.btn-surface` | axis variant | dahlia, peony | Sets variant to “surface”. |
| `.btn-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.btn-wide` | axis width | all | Wider than its content, without filling the row. |
| `.btn-xl` | axis size | all | Sets size to “xl”. |
| `.btn-xs` | axis size | all | Sets size to “xs”. |
| `.btn-xxl` | axis size | all | Sets size to “xxl”. |
| `.btn-xxs` | axis size | all | Sets size to “xxs”. |
| `.btn-xxxl` | axis size | all | Sets size to “xxxl”. |
| `.btn-active` | flag (active) | all | Draw it as the current choice without it being pressed. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.btn`: `:active` `:checked` `:disabled` `:focus-visible` `:hover` `[aria-label]` `[disabled]` `[type=checkbox]` `[type=radio]`
- `.btn-dash`: `:active` `:checked` `:disabled` `:focus` `:focus-visible` `:hover` `[disabled]`
- `.btn-ghost`: `:active` `:checked` `:disabled` `:focus` `:focus-visible` `:hover` `[disabled]`
- `.btn-link`: `:active` `:disabled` `:focus` `:focus-visible` `:hover` `[disabled]`
- `.btn-outline`: `:active` `:checked` `:disabled` `:focus` `:focus-visible` `:hover` `[disabled]`
- `.btn-reverse`: `:active`
- `.btn-soft`: `:active` `:checked` `:disabled` `:focus` `:focus-visible` `:hover` `[disabled]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Button>`: `--btn-bg` `--ripple-size` `--ripple-x` `--ripple-y`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Button>`: `.btn-ripple-wave` is removed once the family's motion on it has run — at once if it draws none.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Button sizes

```html
<button class="btn btn-xs">Xsmall</button>
<button class="btn btn-sm">Small</button>
<button class="btn">Medium</button>
<button class="btn btn-lg">Large</button>
<button class="btn btn-xl">Xlarge</button>
```

### Button colors

```html
<button class="btn btn-neutral">Neutral</button>
<button class="btn btn-primary">Primary</button>
<button class="btn btn-secondary">Secondary</button>
<button class="btn btn-accent">Accent</button>
<button class="btn btn-info">Info</button>
<button class="btn btn-success">Success</button>
<button class="btn btn-warning">Warning</button>
<button class="btn btn-error">Error</button>
```

### Button variants

```html
<button class="btn btn-primary btn-outline">Outline</button>
<button class="btn btn-primary btn-dash">Dash</button>
<button class="btn btn-primary btn-soft">Soft</button>
<button class="btn btn-ghost">Ghost</button>
<button class="btn btn-link">Link</button>
```

### Ripple

```html
<button class="btn btn-ripple">Ripple</button>
<button class="btn btn-primary btn-ripple">Primary</button>
<button class="btn btn-accent btn-lg btn-ripple">Large</button>
<button class="btn btn-secondary btn-soft btn-ripple">Soft</button>
```

### States &amp; widths

```html
<button class="btn btn-primary btn-active">Active</button>
<button class="btn btn-wide">Wide</button>
<button class="btn" disabled="">Disabled</button>
```

### Classic and surface

```html
<button class="btn btn-primary btn-classic">Classic</button>
<button class="btn btn-primary btn-surface">Surface</button>
<button class="btn btn-classic">Classic</button>
<button class="btn btn-surface">Surface</button>
```

### Moving the shadow

```html
<button class="btn btn-primary">Default</button>
<button class="btn btn-primary btn-reverse">Reverse</button>
<button class="btn btn-primary btn-noshadow">None</button>
```


---

# Link

Text that goes somewhere. One class on one <a>, with no structure to wrap, which is why there is no Svelte component for it.

- Group: Actions
- Namespaces: `link`
- Svelte: no wrapper; the classes are written by hand
- Reference SCSS: [cosmos](reference/cosmos/link.scss), [dahlia](reference/dahlia/link.scss), [daisy](reference/daisy/link.scss), [peony](reference/peony/link.scss), [sunflower](reference/sunflower/link.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.link` | plain class | all | Text that goes somewhere. |
| `.link-accent` | plain class | cosmos, dahlia, daisy | Draw the link in the accent colour. |
| `.link-error` | plain class | all | Draw the link in the error colour. |
| `.link-hover` | plain class | all | Underline on hover only, rather than always. |
| `.link-info` | plain class | cosmos, dahlia, daisy, peony | Draw the link in the info colour. |
| `.link-neutral` | plain class | all | Draw the link in the neutral colour. |
| `.link-primary` | plain class | all | Draw the link in the primary colour. |
| `.link-secondary` | plain class | cosmos, dahlia, daisy | Draw the link in the secondary colour. |
| `.link-success` | plain class | all | Draw the link in the success colour. |
| `.link-warning` | plain class | cosmos, dahlia, daisy, peony | Draw the link in the warning colour. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.link`: `:focus` `:focus-visible` `:hover`
- `.link-accent`: `:hover`
- `.link-error`: `:hover`
- `.link-hover`: `:hover`
- `.link-info`: `:hover`
- `.link-neutral`: `:hover`
- `.link-primary`: `:hover`
- `.link-secondary`: `:hover`
- `.link-success`: `:hover`
- `.link-warning`: `:hover`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<a class="link" href="#demo">Default link</a>
```

### Colors

```html
<a class="link link-primary" href="#demo">Primary</a>
<a class="link link-secondary" href="#demo">Secondary</a>
<a class="link link-accent" href="#demo">Accent</a>
<a class="link link-success" href="#demo">Success</a>
<a class="link link-error" href="#demo">Error</a>
```


---

# Join

Glue two or more controls into one object: the inner corners go square, the outer ones keep the family's radius. It reaches into its children through their own radius slots.

- Group: Actions
- Namespaces: `join`
- Svelte: `<Join>`
- Reference SCSS: [cosmos](reference/cosmos/join.scss), [dahlia](reference/dahlia/join.scss), [daisy](reference/daisy/join.scss), [peony](reference/peony/join.scss), [sunflower](reference/sunflower/join.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.join` | root | all | The component itself. |
| `.join-item` | part | all | A child of the join that is not one of the kit's components, and therefore has to be told. |
| `.join-horizontal` | axis direction | all | Sets direction to “horizontal”. |
| `.join-vertical` | axis direction | all | Sets direction to “vertical”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.join-item`: `:disabled` `[disabled]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Buttons

```html
<div class="join">
  <button class="btn join-item">Left</button>
  <button class="btn btn-primary join-item">Center</button>
  <button class="btn join-item">Right</button>
</div>
```

### Input + button

```html
<div class="join">
  <input placeholder="Search…" class="input join-item">
  <button class="btn btn-primary join-item">Go</button>
</div>
```

### Vertical

```html
<div class="join join-vertical">
  <button class="btn join-item">Top</button>
  <button class="btn btn-primary join-item">Middle</button>
  <button class="btn join-item">Bottom</button>
</div>
```


---

# Input

A single-line field. The frame is a hole cut in the page: it sits on surface-1, not above it.

- Group: Form
- Namespaces: `input`
- Svelte: `<Input>`
- Reference SCSS: [cosmos](reference/cosmos/input.scss), [dahlia](reference/dahlia/input.scss), [daisy](reference/daisy/input.scss), [peony](reference/peony/input.scss), [sunflower](reference/sunflower/input.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.input` | root | all | The component itself. |
| `.input-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.input-error` | axis color | all | Sets color to “error”. |
| `.input-ghost` | axis variant | all | Sets variant to “ghost”. |
| `.input-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.input-lg` | axis size | all | Sets size to “lg”. |
| `.input-md` | axis size | all | Sets size to “md”. |
| `.input-neutral` | axis color | all | Sets color to “neutral”. |
| `.input-primary` | axis color | all | Sets color to “primary”. |
| `.input-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.input-sm` | axis size | all | Sets size to “sm”. |
| `.input-success` | axis color | all | Sets color to “success”. |
| `.input-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.input-xl` | axis size | all | Sets size to “xl”. |
| `.input-xs` | axis size | all | Sets size to “xs”. |
| `.input-nospinner` | flag (nospinner) | all | Written by the nospinner prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.input`: `:disabled` `:focus` `:focus-within` `:hover` `[disabled]` `[type=number]`
- `.input-accent`: `:focus` `:focus-within`
- `.input-error`: `:focus` `:focus-within`
- `.input-ghost`: `:focus` `:focus-within`
- `.input-info`: `:focus` `:focus-within`
- `.input-neutral`: `:focus` `:focus-within`
- `.input-nospinner`: `[type=number]`
- `.input-primary`: `:focus` `:focus-within`
- `.input-secondary`: `:focus` `:focus-within`
- `.input-success`: `:focus` `:focus-within`
- `.input-warning`: `:focus` `:focus-within`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<input placeholder="Default input" class="input">
```

### Sizes

```html
<input placeholder="xs" class="input input-xs">
<input placeholder="sm" class="input input-sm">
<input placeholder="base" class="input">
<input placeholder="lg" class="input input-lg">
```

### Colors

```html
<input placeholder="Primary" class="input input-primary">
<input placeholder="Success" class="input input-success">
<input placeholder="Error" class="input input-error">
```

### With inline label

```html
<label class="input">
  <span class="label">https://</span>
  <input type="text" placeholder="example.com">
</label>
```

### Icons and units

```html
<label class="input">
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">…</svg>
  <input placeholder="Search" type="search">
  <kbd>⌘K</kbd>
</label>
<label class="input input-nospinner">
  <input type="number" placeholder="0">
  <span class="label">kg</span>
</label>
```

### Validation

```html
<div>
  <input type="email" required="" placeholder="Email" class="input validator">
</div>
<div>
  <input aria-invalid="true" value="taken" class="input validator">
  <p class="validator-hint">This name is already used</p>
</div>
```


---

# Textarea

A multi-line field. Same frame as the input, free to grow.

- Group: Form
- Namespaces: `textarea`
- Svelte: `<Textarea>`
- Reference SCSS: [cosmos](reference/cosmos/textarea.scss), [dahlia](reference/dahlia/textarea.scss), [daisy](reference/daisy/textarea.scss), [peony](reference/peony/textarea.scss), [sunflower](reference/sunflower/textarea.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.textarea` | root | all | The component itself. |
| `.textarea-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.textarea-error` | axis color | all | Sets color to “error”. |
| `.textarea-ghost` | axis variant | all | Sets variant to “ghost”. |
| `.textarea-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.textarea-lg` | axis size | all | Sets size to “lg”. |
| `.textarea-md` | axis size | all | Sets size to “md”. |
| `.textarea-neutral` | axis color | all | Sets color to “neutral”. |
| `.textarea-primary` | axis color | all | Sets color to “primary”. |
| `.textarea-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.textarea-sm` | axis size | all | Sets size to “sm”. |
| `.textarea-success` | axis color | all | Sets color to “success”. |
| `.textarea-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.textarea-xl` | axis size | all | Sets size to “xl”. |
| `.textarea-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.textarea`: `:disabled` `:focus` `:focus-within` `:hover` `[disabled]`
- `.textarea-accent`: `:focus` `:focus-within`
- `.textarea-error`: `:focus` `:focus-within`
- `.textarea-ghost`: `:focus` `:focus-within`
- `.textarea-info`: `:focus` `:focus-within`
- `.textarea-neutral`: `:focus` `:focus-within`
- `.textarea-primary`: `:focus` `:focus-within`
- `.textarea-secondary`: `:focus` `:focus-within`
- `.textarea-success`: `:focus` `:focus-within`
- `.textarea-warning`: `:focus` `:focus-within`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<textarea placeholder="Default textarea" class="textarea"></textarea>
```

### Colors

```html
<textarea placeholder="Primary" class="textarea textarea-primary"></textarea>
<textarea placeholder="Success" class="textarea textarea-success"></textarea>
<textarea placeholder="Error" class="textarea textarea-error"></textarea>
```


---

# Select

A closed list of choices, drawn as a field so it lines up with the inputs beside it.

- Group: Form
- Namespaces: `select`
- Svelte: `<Select>`
- Reference SCSS: [cosmos](reference/cosmos/select.scss), [dahlia](reference/dahlia/select.scss), [daisy](reference/daisy/select.scss), [peony](reference/peony/select.scss), [sunflower](reference/sunflower/select.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.select` | root | all | The component itself. |
| `.select-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.select-error` | axis color | all | Sets color to “error”. |
| `.select-ghost` | axis variant | all | Sets variant to “ghost”. |
| `.select-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.select-lg` | axis size | all | Sets size to “lg”. |
| `.select-md` | axis size | all | Sets size to “md”. |
| `.select-neutral` | axis color | all | Sets color to “neutral”. |
| `.select-primary` | axis color | all | Sets color to “primary”. |
| `.select-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.select-sm` | axis size | all | Sets size to “sm”. |
| `.select-success` | axis color | all | Sets color to “success”. |
| `.select-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.select-xl` | axis size | all | Sets size to “xl”. |
| `.select-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.select`: `:disabled` `:focus` `:focus-within` `:hover` `:open` `[aria-expanded=true]` `[disabled]` `[multiple]`
- `.select-accent`: `:focus` `:focus-within`
- `.select-error`: `:focus` `:focus-within`
- `.select-ghost`: `:focus` `:focus-within`
- `.select-info`: `:focus` `:focus-within`
- `.select-neutral`: `:focus` `:focus-within`
- `.select-primary`: `:focus` `:focus-within`
- `.select-secondary`: `:focus` `:focus-within`
- `.select-success`: `:focus` `:focus-within`
- `.select-warning`: `:focus` `:focus-within`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Select>`: `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Select>`: a `<ul>` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<Select>`: a `<ul>` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<Select>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<select class="select">
  <option disabled="" hidden="" selected=""></option>
  <option disabled="" selected="">Pick a color</option>
  <option>Crimson</option>  <!-- ×3 -->
</select>
```

### Sizes

```html
<select class="select select-xs">
  <option disabled="" hidden="" selected=""></option>
  <option>xs</option>
</select>
<select class="select select-sm">
  <option disabled="" hidden="" selected=""></option>
  <option>sm</option>
</select>
<select class="select">
  <option disabled="" hidden="" selected=""></option>
  <option>base</option>
</select>
<select class="select select-lg">
  <option disabled="" hidden="" selected=""></option>
  <option>lg</option>
</select>
```

### Options as data

```html
<div>
  <select class="select">
    <option selected="">Pick a fruit</option>
    <option value="apple">Apple</option>
    <option value="pear">Pear</option>
    <option value="plum">Plum</option>
    <option value="mango">Mango</option>
  </select>
  <small>value: —</small>
</div>
```

### Several choices

```html
<div>
  <div class="select" role="combobox" tabindex="0" aria-expanded="false" aria-haspopup="listbox" aria-controls="s7-list">
    <span>Pear</span>
    <select multiple="" tabindex="-1" aria-hidden="true">
      <option value="apple">Apple</option>
      <option value="pear">Pear</option>
      <option value="plum">Plum</option>
      <option value="mango">Mango</option>
    </select>
  </div>
  <small>value: ["pear"]</small>
</div>
```

### Validation

```html
<div>
  <select required="" class="select validator">
    <option disabled="" hidden="" selected="">Required</option>
    <option value="apple">Apple</option>
    <option value="pear">Pear</option>
    <option value="plum">Plum</option>
    <option value="mango">Mango</option>
  </select>
</div>
```


---

# Combobox

A field whose value is looked up in a list while typing. Strict, the value is a picked option and a hidden select carries it; free, the value is the text and the options only complete it. Options come from a list, a function or an address answering JSON. The frame is the family's .input, the list its .list-suggestions.

- Group: Form
- Namespaces: `combobox`
- Svelte: `<Combobox>`
- Reference SCSS: [cosmos](reference/cosmos/combobox.scss), [dahlia](reference/dahlia/combobox.scss), [daisy](reference/daisy/combobox.scss), [peony](reference/peony/combobox.scss), [sunflower](reference/sunflower/combobox.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.combobox` | root | all | Holds the .input frame and the hidden select. |
| `.combobox-multiple` | part | all | Written when several can be picked: each option carries a box. |
| `.combobox-option` | part | all | One option row (also a .list-row). |
| `.combobox-lg` | axis size | all | Sets size to “lg”. |
| `.combobox-md` | axis size | all | Sets size to “md”. |
| `.combobox-sm` | axis size | all | Sets size to “sm”. |
| `.combobox-xl` | axis size | all | Sets size to “xl”. |
| `.combobox-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.combobox-option`: `[aria-selected=true]` `[data-active]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Combobox>`: `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Combobox>`: a `<ul>` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<Combobox>`: a `<ul>` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<Combobox>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Strict

```html
<div>
  <div class="combobox">
    <label class="input">
      <input placeholder="Country" type="text" role="combobox" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s1-list">
    </label>
    <select name="country" hidden="" aria-hidden="true" tabindex="-1"></select>
  </div>
  <small>value: —</small>
</div>
```

### Free: autocompletion

```html
<div>
  <div class="combobox">
    <label class="input">
      <input placeholder="Fruit" type="text" role="combobox" name="fruit" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s2-list">
    </label>
  </div>
  <small>text: — · created: —</small>
</div>
```

### From a function

```html
<div>
  <div class="combobox">
    <label class="input">
      <input placeholder="Country (300 ms)" type="text" role="combobox" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s3-list">
    </label>
    <select hidden="" aria-hidden="true" tabindex="-1"></select>
  </div>
</div>
```

### Multiple

```html
<div>
  <div class="combobox combobox-multiple">
    <label class="input">
      <input placeholder="Countries" type="text" role="combobox" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s4-list">
    </label>
    <select name="countries" multiple="" hidden="" aria-hidden="true" tabindex="-1"></select>
  </div>
  <small>—</small>
</div>
```

### Sizes

```html
<div class="combobox combobox-sm">
  <label class="input">
    <input placeholder="Small" type="text" role="combobox" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s5-list">
  </label>
  <select hidden="" aria-hidden="true" tabindex="-1"></select>
</div>
<div class="combobox">
  <label class="input">
    <input placeholder="Medium" type="text" role="combobox" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s6-list">
  </label>
  <select hidden="" aria-hidden="true" tabindex="-1"></select>
</div>
<div class="combobox combobox-lg">
  <label class="input">
    <input placeholder="Large" type="text" role="combobox" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s7-list">
  </label>
  <select hidden="" aria-hidden="true" tabindex="-1"></select>
</div>
```


---

# Number input

A number field, its figure aligned to the end like a number in a column. It takes . and , alike as the decimal separator, whatever the browser's language, and its value is always a number. With controls, a − and a + step it within its own min, max and step.

- Group: Form
- Namespaces: `number-input`
- Svelte: `<NumberInput>`
- Reference SCSS: [cosmos](reference/cosmos/number-input.scss), [dahlia](reference/dahlia/number-input.scss), [daisy](reference/daisy/number-input.scss), [peony](reference/peony/number-input.scss), [sunflower](reference/sunflower/number-input.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.number-input` | root | all | The frame, field-shaped. |
| `.number-input-dec` | part | all | The − button, drawn with controls. |
| `.number-input-field` | part | all | The input: a text field with a numeric keyboard, filtered to what a number can be. Its figure sits at the end, or centred between the buttons. |
| `.number-input-inc` | part | all | The + button, drawn with controls. |
| `.number-input-lg` | axis size | all | Sets size to “lg”. |
| `.number-input-md` | axis size | all | Sets size to “md”. |
| `.number-input-sm` | axis size | all | Sets size to “sm”. |
| `.number-input-xl` | axis size | all | Sets size to “xl”. |
| `.number-input-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.number-input`: `:focus-within`
- `.number-input-dec`: `:disabled` `:hover`
- `.number-input-field`: `:focus`
- `.number-input-inc`: `:disabled` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<NumberInput>`: `--number-input-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Basic

```html
<div class="number-input">
  <input type="text" inputmode="text" autocomplete="off" role="spinbutton" aria-valuenow="12.5" class="number-input-field" value="12.5">
  <input type="hidden" name="price" value="12.5">
</div>
<code>12.5 (number)</code>
```

### With controls

```html
<div class="number-input">
  <button type="button" class="number-input-dec" tabindex="-1" aria-label="Decrease">−</button>
  <input type="text" inputmode="decimal" autocomplete="off" role="spinbutton" aria-valuenow="2" aria-valuemin="0" aria-valuemax="10" class="number-input-field" value="2">
  <input type="hidden" name="qty" value="2">
  <button type="button" class="number-input-inc" tabindex="-1" aria-label="Increase">+</button>
</div>
<span>2</span>
```

### Sizes and step

```html
<div class="number-input number-input-sm">
  <input type="text" inputmode="text" autocomplete="off" role="spinbutton" aria-valuenow="1" class="number-input-field" value="1">
</div>
<div class="number-input">
  <input type="text" inputmode="text" autocomplete="off" role="spinbutton" aria-valuenow="5" class="number-input-field" value="5">
</div>
<div class="number-input number-input-lg">
  <input type="text" inputmode="text" autocomplete="off" role="spinbutton" aria-valuenow="0.5" class="number-input-field" value="0.5">
</div>
<div class="number-input number-input-lg">
  <button type="button" class="number-input-dec" tabindex="-1" aria-label="Decrease">−</button>
  <input type="text" inputmode="text" autocomplete="off" role="spinbutton" aria-valuenow="0.5" class="number-input-field" value="0.5">
  <button type="button" class="number-input-inc" tabindex="-1" aria-label="Increase">+</button>
</div>
<div class="number-input">
  <input type="text" inputmode="text" autocomplete="off" role="spinbutton" aria-valuenow="3" class="number-input-field" value="3" disabled="">
</div>
```


---

# Date picker

A field that opens a calendar: an Input, a Dropdown and an inline Calendar put together. It draws nothing of its own, so it wears the family's input, dropdown and calendar. A day, a day and a time, a time alone, or a range. The value lives in a real, visually hidden <input type="date"> (datetime-local, time): a form submits and validates it as the browser does.

- Group: Form
- Namespaces: none: it draws nothing, so a family has nothing to style
- Svelte: no wrapper; the classes are written by hand
- Reference SCSS: none: no family styles it

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### One date

```html
<span>
  <div class="dropdown dropdown-fixed">
    <input aria-expanded="false" aria-controls="s1-content" aria-haspopup="dialog" placeholder="Pick a day" readonly="" value="" class="input">
  </div>
  <input type="date" name="day" value="" tabindex="-1" aria-hidden="true">
</span>
<span>—</span>
```

### A range

```html
<span>
  <div class="dropdown dropdown-fixed">
    <input aria-expanded="false" aria-controls="s2-content" aria-haspopup="dialog" placeholder="Arrival – departure" readonly="" value="" class="input">
  </div>
  <input type="text" value="" tabindex="-1" aria-hidden="true">
</span>
```

### A day and a time, required

```html
<span>
  <div class="dropdown dropdown-fixed">
    <input aria-expanded="false" aria-controls="s3-content" aria-haspopup="dialog" placeholder="Meeting" readonly="" aria-required="true" value="" class="input validator">
  </div>
  <input type="datetime-local" name="meeting" required="" value="" tabindex="-1" aria-hidden="true">
</span>
```


---

# Calendar

A date picker, drawn by air-datepicker (vendored, MIT). `.calendar` is the one class we own: the library’s own classes (`.air-datepicker-cell`, `.-selected-`…) are styled by each family from under it. Without the Svelte component, put air-datepicker inside a `<div class="calendar">` — or, as a popup, give it that element as its `container`.

- Group: Form
- Namespaces: `calendar`
- Svelte: `<Calendar>`
- Reference SCSS: [cosmos](reference/cosmos/calendar.scss), [dahlia](reference/dahlia/calendar.scss), [daisy](reference/daisy/calendar.scss), [peony](reference/peony/calendar.scss), [sunflower](reference/sunflower/calendar.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.calendar` | root | all | The component itself. |
| `.calendar-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.calendar-error` | axis color | all | Sets color to “error”. |
| `.calendar-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.calendar-lg` | axis size | all | Sets size to “lg”. |
| `.calendar-md` | axis size | all | Sets size to “md”. |
| `.calendar-neutral` | axis color | all | Sets color to “neutral”. |
| `.calendar-primary` | axis color | all | Sets color to “primary”. |
| `.calendar-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.calendar-sm` | axis size | all | Sets size to “sm”. |
| `.calendar-success` | axis color | all | Sets color to “success”. |
| `.calendar-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.calendar-xl` | axis size | all | Sets size to “xl”. |
| `.calendar-xs` | axis size | all | Sets size to “xs”. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Calendar>`: `--calendar-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Inline

```html
<div>
  <div class="calendar"></div>
  <small>value: 11/20/2026</small>
</div>
```

### Range, in French

```html
<div>
  <div class="calendar calendar-secondary"></div>
  <small>value: —</small>
</div>
```

### As a field

```html
<div>
  <div class="calendar">
    <input class="input" placeholder="Pick a date" readonly="">
  </div>
  <small>value: —</small>
</div>
```

### Sizes

```html
<div class="calendar calendar-sm"></div>
<div class="calendar calendar-lg"></div>
```


---

# Color picker

One colour, edited in OKLCH: lightness, chroma and hue, each a slider whose track is the gradient it moves along, plus the raw value for anything the sliders cannot say. A panel, not a popover: put it in a Dropdown to float it.

- Group: Form
- Namespaces: `color-picker`
- Svelte: `<ColorPicker>`
- Reference SCSS: [cosmos](reference/cosmos/color-picker.scss), [dahlia](reference/dahlia/color-picker.scss), [daisy](reference/daisy/color-picker.scss), [peony](reference/peony/color-picker.scss), [sunflower](reference/sunflower/color-picker.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.color-picker` | root | all | The panel: a box of its own, unless flat. |
| `.color-picker-channel` | part | all | One channel: its letter, its track, its number. |
| `.color-picker-head` | part | all | The preview and the value field, on one line. |
| `.color-picker-presets` | part | all | A row of .swatch, one click away. |
| `.color-picker-preview` | part | all | The colour, over a checkerboard. Reads --color-picker-value. |
| `.color-picker-track` | part | all | A range input painted with --color-picker-track. |
| `.color-picker-value` | part | all | The raw value field, an .input. |
| `.color-picker-lg` | axis size | all | Sets size to “lg”. |
| `.color-picker-md` | axis size | all | Sets size to “md”. |
| `.color-picker-sm` | axis size | all | Sets size to “sm”. |
| `.color-picker-xl` | axis size | all | Sets size to “xl”. |
| `.color-picker-xs` | axis size | all | Sets size to “xs”. |
| `.color-picker-flat` | flag (flat) | all | No box: the host — a dropdown, a card — draws it. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.color-picker-track`: `:focus-visible`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<ColorPicker>`: `--color-picker-bg` `--color-picker-track` `--color-picker-value` `--swatch-color`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Panel

```html
<div>
  <div class="color-picker" style="--color-picker-value: oklch(62% 0.19 260)">
    <div class="color-picker-head">
      <span class="color-picker-preview"></span>
      <input class="input input-sm color-picker-value" aria-label="Value" spellcheck="false" value="oklch(62% 0.19 260)">
    </div>
    <label class="color-picker-channel">
      <span title="Lightness">L</span>
      <input type="range" class="color-picker-track" aria-label="Lightness" min="0" max="1" step="0.005" value="0.62" style="--color-picker-track: linear-gradient(to right, oklch(0% 0.19 260), oklch(25% 0.19 260), oklch(50% 0.19 260), oklch(75% 0.19 260), oklch(100% 0.19 260))">
      <output>62</output>
    </label>
    <label class="color-picker-channel">
      <span title="Chroma">C</span>
      <input type="range" class="color-picker-track" aria-label="Chroma" min="0" max="0.37" step="0.005" value="0.19" style="--color-picker-track: linear-gradient(to right, oklch(62% 0 260), oklch(62% 0.1 260), oklch(62% 0.2 260), oklch(62% 0.3 260), oklch(62% 0.37 260))">
      <output>0.19</output>
    </label>
    <label class="color-picker-channel">
      <span title="Hue">H</span>
      <input type="range" class="color-picker-track" aria-label="Hue" min="0" max="360" step="1" value="260" style="--color-picker-track: linear-gradient(to right, oklch(62% 0.19 0), oklch(62% 0.19 30), oklch(62% 0.19 60), oklch(62% 0.19 90), oklch(62% 0.19 120), oklch(62% 0.19 150), oklch(62% 0.19 180), oklch(62% 0.19 210), oklch(62% 0.19 240), oklch(62% 0.19 270), oklch(62% 0.19 300), oklch(62% 0.19 330), oklch(62% 0.19 360))">
      <output>260</output>
    </label>
    <div class="color-picker-presets">
      <button type="button" class="swatch swatch-sm swatch-active" aria-label="oklch(62% 0.19 260)" title="oklch(62% 0.19 260)" style="--swatch-color: oklch(62% 0.19 260)"></button>
      <button type="button" class="swatch swatch-sm" aria-label="oklch(65% 0.2 25)" title="oklch(65% 0.2 25)" style="--swatch-color: oklch(65% 0.2 25)"></button>
      <button type="button" class="swatch swatch-sm" aria-label="oklch(80% 0.16 85)" title="oklch(80% 0.16 85)" style="--swatch-color: oklch(80% 0.16 85)"></button>
      <button type="button" class="swatch swatch-sm" aria-label="oklch(70% 0.15 150)" title="oklch(70% 0.15 150)" style="--swatch-color: oklch(70% 0.15 150)"></button>
      <button type="button" class="swatch swatch-sm" aria-label="oklch(55% 0.2 300)" title="oklch(55% 0.2 300)" style="--swatch-color: oklch(55% 0.2 300)"></button>
      <button type="button" class="swatch swatch-sm" aria-label="oklch(25% 0.02 260)" title="oklch(25% 0.02 260)" style="--swatch-color: oklch(25% 0.02 260)"></button>
    </div>
  </div>
  <code>oklch(62% 0.19 260)</code>
</div>
```

### In a dropdown

```html
<div>
  <div class="dropdown dropdown-fixed">
    <button aria-expanded="false" aria-controls="s1-content" aria-haspopup="true" class="btn">
      <span class="swatch swatch-xs swatch-circle" style="--swatch-color: oklch(70% 0.15 150)"></span>
      Colour
    </button>
  </div>
</div>
```


---

# File input

The browser's file picker wearing the kit's field frame. The button inside it is the ::file-selector-button, painted like a button.

- Group: Form
- Namespaces: `file-input`
- Svelte: `<FileInput>`
- Reference SCSS: [cosmos](reference/cosmos/file-input.scss), [dahlia](reference/dahlia/file-input.scss), [daisy](reference/daisy/file-input.scss), [peony](reference/peony/file-input.scss), [sunflower](reference/sunflower/file-input.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.file-input` | root | all | The component itself. |
| `.file-input-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.file-input-error` | axis color | all | Sets color to “error”. |
| `.file-input-ghost` | axis variant | all | Sets variant to “ghost”. |
| `.file-input-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.file-input-lg` | axis size | all | Sets size to “lg”. |
| `.file-input-md` | axis size | all | Sets size to “md”. |
| `.file-input-neutral` | axis color | all | Sets color to “neutral”. |
| `.file-input-primary` | axis color | all | Sets color to “primary”. |
| `.file-input-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.file-input-sm` | axis size | all | Sets size to “sm”. |
| `.file-input-success` | axis color | all | Sets color to “success”. |
| `.file-input-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.file-input-xl` | axis size | all | Sets size to “xl”. |
| `.file-input-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.file-input`: `:disabled` `:focus` `:focus-within` `[disabled]`
- `.file-input-accent`: `:focus` `:focus-within`
- `.file-input-error`: `:focus` `:focus-within`
- `.file-input-ghost`: `:focus` `:focus-within`
- `.file-input-info`: `:focus` `:focus-within`
- `.file-input-neutral`: `:focus` `:focus-within`
- `.file-input-primary`: `:focus` `:focus-within`
- `.file-input-secondary`: `:focus` `:focus-within`
- `.file-input-success`: `:focus` `:focus-within`
- `.file-input-warning`: `:focus` `:focus-within`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<input type="file" class="file-input">
```

### Sizes

```html
<input type="file" class="file-input file-input-xs">
<input type="file" class="file-input file-input-sm">
<input type="file" class="file-input">
<input type="file" class="file-input file-input-lg">
```

### Validation

```html
<div>
  <input required="" accept="image/*" type="file" class="file-input validator">
</div>
<div>
  <input aria-invalid="true" type="file" class="file-input validator">
  <p class="validator-hint">The server refused this file</p>
</div>
```


---

# File dropzone

Its content becomes a place to drop files on. It draws nothing of its own: the content is the look, `over` says when files are dragged above it, `open()` opens the dialog. A hidden file input holds the files, so a form submits and validates them.

- Group: Form
- Namespaces: none: it draws nothing, so a family has nothing to style
- Svelte: no wrapper; the classes are written by hand
- Reference SCSS: none: no family styles it

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Any content

```html
<div>
  <div class="card card-border">
    Drop pictures here, or
    <button type="button" class="btn btn-sm">browse</button>
  </div>
  <input type="file" accept="image/*" multiple="" tabindex="-1" aria-hidden="true">
</div>
<span>—</span>
```


---

# Checkbox

An independent yes/no. Several checked at once is a legal state — that is what separates it from the radio.

- Group: Form
- Namespaces: `checkbox`
- Svelte: `<Checkbox>`
- Reference SCSS: [cosmos](reference/cosmos/checkbox.scss), [dahlia](reference/dahlia/checkbox.scss), [daisy](reference/daisy/checkbox.scss), [peony](reference/peony/checkbox.scss), [sunflower](reference/sunflower/checkbox.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.checkbox` | root | all | The component itself. |
| `.checkbox-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.checkbox-error` | axis color | all | Sets color to “error”. |
| `.checkbox-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.checkbox-lg` | axis size | all | Sets size to “lg”. |
| `.checkbox-md` | axis size | all | Sets size to “md”. |
| `.checkbox-neutral` | axis color | all | Sets color to “neutral”. |
| `.checkbox-outline` | axis variant | all | Sets variant to “outline”. |
| `.checkbox-primary` | axis color | all | Sets color to “primary”. |
| `.checkbox-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.checkbox-sm` | axis size | all | Sets size to “sm”. |
| `.checkbox-square` | axis shape | all | Sets shape to “square”. |
| `.checkbox-success` | axis color | all | Sets color to “success”. |
| `.checkbox-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.checkbox-xl` | axis size | all | Sets size to “xl”. |
| `.checkbox-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.checkbox`: `:active` `:checked` `:disabled` `:focus-visible` `:hover` `:indeterminate` `[aria-checked=true]`
- `.checkbox-outline`: `:checked` `[aria-checked=true]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Sizes

```html
<input type="checkbox" class="checkbox checkbox-xs" checked="">
<input type="checkbox" class="checkbox checkbox-sm" checked="">
<input type="checkbox" class="checkbox" checked="">
<input type="checkbox" class="checkbox checkbox-lg" checked="">
```

### Colors

```html
<input type="checkbox" class="checkbox checkbox-primary" checked="">
<input type="checkbox" class="checkbox checkbox-secondary" checked="">
<input type="checkbox" class="checkbox checkbox-accent" checked="">
<input type="checkbox" class="checkbox checkbox-success" checked="">
<input type="checkbox" class="checkbox checkbox-warning" checked="">
<input type="checkbox" class="checkbox checkbox-error" checked="">
```

### Variants

```html
<input type="checkbox" class="checkbox checkbox-primary checkbox-outline" checked="">
<input type="checkbox" class="checkbox checkbox-accent checkbox-square" checked="">
<input type="checkbox" disabled="" class="checkbox" checked="">
```


---

# Radio

One choice out of several. Exclusivity is the point; if two can be on, it is a checkbox.

- Group: Form
- Namespaces: `radio`
- Svelte: `<Radio>`
- Reference SCSS: [cosmos](reference/cosmos/radio.scss), [dahlia](reference/dahlia/radio.scss), [daisy](reference/daisy/radio.scss), [peony](reference/peony/radio.scss), [sunflower](reference/sunflower/radio.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.radio` | root | all | The component itself. |
| `.radio-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.radio-error` | axis color | all | Sets color to “error”. |
| `.radio-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.radio-lg` | axis size | all | Sets size to “lg”. |
| `.radio-md` | axis size | all | Sets size to “md”. |
| `.radio-neutral` | axis color | all | Sets color to “neutral”. |
| `.radio-primary` | axis color | all | Sets color to “primary”. |
| `.radio-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.radio-sm` | axis size | all | Sets size to “sm”. |
| `.radio-square` | axis shape | all | Sets shape to “square”. |
| `.radio-success` | axis color | all | Sets color to “success”. |
| `.radio-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.radio-xl` | axis size | all | Sets size to “xl”. |
| `.radio-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.radio`: `:checked` `:disabled` `:focus-visible` `:hover` `[aria-checked=true]`
- `.radio-xl`: `[type=radio]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Colors

```html
<input type="radio" name="rc" checked="" class="radio radio-primary">
<input type="radio" name="rc" checked="" class="radio radio-secondary">
<input type="radio" name="rc" checked="" class="radio radio-accent">
<input type="radio" name="rc" checked="" class="radio radio-success">
<input type="radio" name="rc" checked="" class="radio radio-error">
```

### Sizes

```html
<input type="radio" name="rs" checked="" class="radio radio-xs">
<input type="radio" name="rs" checked="" class="radio radio-sm">
<input type="radio" name="rs" checked="" class="radio">
<input type="radio" name="rs" checked="" class="radio radio-lg">
```


---

# Toggle

A switch that takes effect immediately, unlike a checkbox that waits for a submit.

- Group: Form
- Namespaces: `toggle`
- Svelte: `<Toggle>`
- Reference SCSS: [cosmos](reference/cosmos/toggle.scss), [dahlia](reference/dahlia/toggle.scss), [daisy](reference/daisy/toggle.scss), [peony](reference/peony/toggle.scss), [sunflower](reference/sunflower/toggle.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.toggle` | root | all | The component itself. |
| `.toggle-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.toggle-error` | axis color | all | Sets color to “error”. |
| `.toggle-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.toggle-lg` | axis size | all | Sets size to “lg”. |
| `.toggle-md` | axis size | all | Sets size to “md”. |
| `.toggle-neutral` | axis color | all | Sets color to “neutral”. |
| `.toggle-primary` | axis color | all | Sets color to “primary”. |
| `.toggle-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.toggle-sm` | axis size | all | Sets size to “sm”. |
| `.toggle-success` | axis color | all | Sets color to “success”. |
| `.toggle-track` | axis variant | all | Sets variant to “track”. |
| `.toggle-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.toggle-xl` | axis size | all | Sets size to “xl”. |
| `.toggle-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.toggle`: `:active` `:checked` `:disabled` `:focus-visible` `:indeterminate` `[aria-checked=true]`
- `.toggle-accent`: `:checked` `[aria-checked=true]`
- `.toggle-error`: `:checked` `[aria-checked=true]`
- `.toggle-info`: `:checked` `[aria-checked=true]`
- `.toggle-neutral`: `:checked` `[aria-checked=true]`
- `.toggle-primary`: `:checked` `[aria-checked=true]`
- `.toggle-secondary`: `:checked` `[aria-checked=true]`
- `.toggle-success`: `:checked` `[aria-checked=true]`
- `.toggle-track`: `:checked` `[aria-checked=true]`
- `.toggle-warning`: `:checked` `[aria-checked=true]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<input type="checkbox" class="toggle">
<input type="checkbox" class="toggle" checked="">
```

### Colors

```html
<input type="checkbox" class="toggle toggle-primary" checked="">
<input type="checkbox" class="toggle toggle-secondary" checked="">
<input type="checkbox" class="toggle toggle-accent" checked="">
<input type="checkbox" class="toggle toggle-success" checked="">
<input type="checkbox" class="toggle toggle-error" checked="">
```

### Track variant

```html
<input type="checkbox" class="toggle toggle-primary toggle-track" checked="">
<input type="checkbox" class="toggle toggle-accent toggle-track" checked="">
<input type="checkbox" class="toggle toggle-success toggle-track" checked="">
```


---

# Switch

One choice among a few, as a pill track. A radio group underneath: keyboard, forms and screen readers treat it as one. For many choices, use a select.

- Group: Form
- Namespaces: `switch`
- Svelte: `<Switch>`
- Reference SCSS: [cosmos](reference/cosmos/switch.scss), [dahlia](reference/dahlia/switch.scss), [daisy](reference/daisy/switch.scss), [peony](reference/peony/switch.scss), [sunflower](reference/sunflower/switch.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.switch` | root | all | The track. |
| `.switch-indicator` | part | all | A piece the component draws; never opted into. |
| `.switch-input` | part | all | The radio, laid invisibly over its label. |
| `.switch-item` | part | all | One label; filled when its radio is checked. |
| `.switch-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.switch-error` | axis color | all | Sets color to “error”. |
| `.switch-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.switch-lg` | axis size | all | Sets size to “lg”. |
| `.switch-md` | axis size | all | Sets size to “md”. |
| `.switch-neutral` | axis color | all | Sets color to “neutral”. |
| `.switch-primary` | axis color | all | Sets color to “primary”. |
| `.switch-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.switch-sm` | axis size | all | Sets size to “sm”. |
| `.switch-success` | axis color | all | Sets color to “success”. |
| `.switch-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.switch-xl` | axis size | all | Sets size to “xl”. |
| `.switch-xs` | axis size | all | Sets size to “xs”. |
| `.switch-block` | flag (block) | all | Written by the block prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.switch-input`: `:checked` `:disabled` `:focus-visible`
- `.switch-item`: `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Switch>`: `--switch-bg` `--switch-w` `--switch-x`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Basic

```html
<div class="switch" role="radiogroup" aria-label="View">
  <span class="switch-indicator" aria-hidden="true"></span>
  <label class="switch-item">
    <input type="radio" class="switch-input" name="switch-brc9hgz" value="list" checked="">
    list
  </label>
  <label class="switch-item">
    <input type="radio" class="switch-input" name="switch-brc9hgz" value="grid">
    grid
  </label>
  <label class="switch-item">
    <input type="radio" class="switch-input" name="switch-brc9hgz" value="board">
    board
  </label>
</div>
<span>list</span>
```

### Sizes, colors, block

```html
<div>
  <div class="switch switch-primary switch-sm" role="radiogroup">
    <span class="switch-indicator" aria-hidden="true"></span>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-1c2uvpy" value="day" checked="">
      day
    </label>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-1c2uvpy" value="week">
      week
    </label>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-1c2uvpy" value="month">
      month
    </label>
  </div>
  <div class="switch" role="radiogroup">
    <span class="switch-indicator" aria-hidden="true"></span>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-8wfduux" value="a">
      Monthly
    </label>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-8wfduux" value="b" checked="">
      Yearly
    </label>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-8wfduux" value="c" disabled="">
      Lifetime
    </label>
  </div>
  <div class="switch switch-lg" role="radiogroup">
    <span class="switch-indicator" aria-hidden="true"></span>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-9njiauk" value="S">
      S
    </label>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-9njiauk" value="M" checked="">
      M
    </label>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-9njiauk" value="L">
      L
    </label>
    <label class="switch-item">
      <input type="radio" class="switch-input" name="switch-9njiauk" value="XL">
      XL
    </label>
  </div>
  <div>
    <div class="switch switch-block" role="radiogroup">
      <span class="switch-indicator" aria-hidden="true"></span>
      <label class="switch-item">
        <input type="radio" class="switch-input" name="switch-x1tsbfr" value="Overview">
        Overview
      </label>
      <label class="switch-item">
        <input type="radio" class="switch-input" name="switch-x1tsbfr" value="Activity" checked="">
        Activity
      </label>
      <label class="switch-item">
        <input type="radio" class="switch-input" name="switch-x1tsbfr" value="Settings">
        Settings
      </label>
    </div>
  </div>
</div>
```


---

# Range

A value picked along a track, where the approximate position matters more than the number.

- Group: Form
- Namespaces: `range`
- Svelte: `<Range>`
- Reference SCSS: [cosmos](reference/cosmos/range.scss), [dahlia](reference/dahlia/range.scss), [daisy](reference/daisy/range.scss), [peony](reference/peony/range.scss), [sunflower](reference/sunflower/range.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.range` | root | all | The component itself. |
| `.range-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.range-error` | axis color | all | Sets color to “error”. |
| `.range-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.range-lg` | axis size | all | Sets size to “lg”. |
| `.range-md` | axis size | all | Sets size to “md”. |
| `.range-neutral` | axis color | all | Sets color to “neutral”. |
| `.range-primary` | axis color | all | Sets color to “primary”. |
| `.range-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.range-sm` | axis size | all | Sets size to “sm”. |
| `.range-success` | axis color | all | Sets color to “success”. |
| `.range-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.range-xl` | axis size | all | Sets size to “xl”. |
| `.range-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.range`: `:active` `:disabled` `:focus` `:focus-visible` `:hover` `[data-fill]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Range>`: `--range-bg` `--range-pct`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<input type="range" min="0" max="100" class="range" data-fill="true" value="40" style="--range-pct: 40%">
```

### Colors

```html
<input type="range" min="0" max="100" class="range range-primary" data-fill="true" value="60" style="--range-pct: 60%">
<input type="range" min="0" max="100" class="range range-secondary" data-fill="true" value="60" style="--range-pct: 60%">
<input type="range" min="0" max="100" class="range range-accent" data-fill="true" value="60" style="--range-pct: 60%">
```


---

# Rating

A whole-number score picked from a row of icons. Real radios, drawn through a CSS mask: they submit with a form and follow the arrow keys.

- Group: Form
- Namespaces: `rating`
- Svelte: `<Rating>`
- Reference SCSS: [cosmos](reference/cosmos/rating.scss), [dahlia](reference/dahlia/rating.scss), [daisy](reference/daisy/rating.scss), [peony](reference/peony/rating.scss), [sunflower](reference/sunflower/rating.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.rating` | root | all | The row; holds the icon as --rating-mask (a star by default). |
| `.rating-item` | part | all | One radio, drawn as the icon. Filled up to the checked one; hover previews. |
| `.rating-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.rating-error` | axis color | all | Sets color to “error”. |
| `.rating-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.rating-lg` | axis size | all | Sets size to “lg”. |
| `.rating-md` | axis size | all | Sets size to “md”. |
| `.rating-neutral` | axis color | all | Sets color to “neutral”. |
| `.rating-primary` | axis color | all | Sets color to “primary”. |
| `.rating-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.rating-sm` | axis size | all | Sets size to “sm”. |
| `.rating-success` | axis color | all | Sets color to “success”. |
| `.rating-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.rating-xl` | axis size | all | Sets size to “xl”. |
| `.rating-xs` | axis size | all | Sets size to “xs”. |
| `.rating-readonly` | flag (readonly) | all | Written by the readonly prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.rating`: `:hover`
- `.rating-item`: `:checked` `:disabled` `:focus-visible` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Rating>`: `--rating-mask`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Pick a score

```html
<div class="rating" role="radiogroup" aria-label="Rating">
  <input type="radio" class="rating-item" name="rating-pdudeuj" value="1" aria-label="1 / 5">
  <input type="radio" class="rating-item" name="rating-pdudeuj" value="2" aria-label="2 / 5">
  <input type="radio" class="rating-item" name="rating-pdudeuj" value="3" aria-label="3 / 5" checked="">
  <input type="radio" class="rating-item" name="rating-pdudeuj" value="4" aria-label="4 / 5">
  <input type="radio" class="rating-item" name="rating-pdudeuj" value="5" aria-label="5 / 5">
</div>
<span>3 / 5</span>
```

### Sizes and colors

```html
<div>
  <div class="rating rating-primary rating-sm" role="radiogroup" aria-label="Rating">
    <input type="radio" class="rating-item" name="rating-t6y7psq" value="1" aria-label="1 / 5">
    <input type="radio" class="rating-item" name="rating-t6y7psq" value="2" aria-label="2 / 5">
    <input type="radio" class="rating-item" name="rating-t6y7psq" value="3" aria-label="3 / 5">
    <input type="radio" class="rating-item" name="rating-t6y7psq" value="4" aria-label="4 / 5" checked="">
    <input type="radio" class="rating-item" name="rating-t6y7psq" value="5" aria-label="5 / 5">
  </div>
  <div class="rating" role="radiogroup" aria-label="Rating">
    <input type="radio" class="rating-item" name="rating-h8eburn" value="1" aria-label="1 / 5">
    <input type="radio" class="rating-item" name="rating-h8eburn" value="2" aria-label="2 / 5">
    <input type="radio" class="rating-item" name="rating-h8eburn" value="3" aria-label="3 / 5">
    <input type="radio" class="rating-item" name="rating-h8eburn" value="4" aria-label="4 / 5" checked="">
    <input type="radio" class="rating-item" name="rating-h8eburn" value="5" aria-label="5 / 5">
  </div>
  <div class="rating rating-error rating-lg" role="radiogroup" aria-label="Rating" style="--rating-mask: url(&amp;quot">
    <input type="radio" class="rating-item" name="rating-ib1jl1y" value="1" aria-label="1 / 3">
    <input type="radio" class="rating-item" name="rating-ib1jl1y" value="2" aria-label="2 / 3" checked="">
    <input type="radio" class="rating-item" name="rating-ib1jl1y" value="3" aria-label="3 / 3">
  </div>
</div>
```

### Read only

```html
<div class="rating rating-readonly" role="radiogroup" aria-label="Rating">
  <input type="radio" class="rating-item" name="rating-fzr7i7d" value="1" aria-label="1 / 5" disabled="">
  <input type="radio" class="rating-item" name="rating-fzr7i7d" value="2" aria-label="2 / 5" disabled="">
  <input type="radio" class="rating-item" name="rating-fzr7i7d" value="3" aria-label="3 / 5" disabled="">
  <input type="radio" class="rating-item" name="rating-fzr7i7d" value="4" aria-label="4 / 5" checked="" disabled="">
  <input type="radio" class="rating-item" name="rating-fzr7i7d" value="5" aria-label="5 / 5" disabled="">
</div>
```


---

# Chips input

An accumulator: several values, each a chip, collected from a field. The field is any component — a plain input by default, or an Input, a Select, a Combobox — that calls add(value). The frame is the family's .input, grown to wrap.

- Group: Form
- Namespaces: `chips-input`
- Svelte: `<ChipsInput>`
- Reference SCSS: [cosmos](reference/cosmos/chips-input.scss), [dahlia](reference/dahlia/chips-input.scss), [daisy](reference/daisy/chips-input.scss), [peony](reference/peony/chips-input.scss), [sunflower](reference/sunflower/chips-input.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.chips-input` | root | all | The grown .input frame holding the chips and the field. |
| `.chips-input-list` | part | all | A piece the component draws; never opted into. |
| `.chips-input-remove` | part | all | A chip's remove button. |
| `.chips-input-bottom` | axis side | none yet | Sets side to “bottom”. |
| `.chips-input-end` | axis side | all | Sets side to “end”. |
| `.chips-input-lg` | axis size | all | Sets size to “lg”. |
| `.chips-input-md` | axis size | all | Sets size to “md”. |
| `.chips-input-sm` | axis size | all | Sets size to “sm”. |
| `.chips-input-start` | axis side | all | Sets side to “start”. |
| `.chips-input-top` | axis side | all | Sets side to “top”. |
| `.chips-input-xl` | axis size | all | Sets size to “xl”. |
| `.chips-input-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.chips-input-list`: `:empty`
- `.chips-input-remove`: `:focus-visible` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<ChipsInput>`: `--motion-dx` `--motion-dy` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<ChipsInput>`: a `<li>` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<ChipsInput>`: a `<li>` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<ChipsInput>`: a `<li>` is marked `data-motion="move"` when the list reorders, `--motion-dx/dy` holding where it came from: the family plays it back from there.
- `<ChipsInput>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.
- `<ChipsInput>`: The `animate` prop hands the move to a Svelte animation instead (`flip`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Free values

```html
<div>
  <div class="chips-input">
    <input class="input" value="" placeholder="Add a tag">
    <ul class="chips-input-list">
      <li class="chip chip-soft chip-primary">
        svelte
        <button type="button" class="chips-input-remove" aria-label="Remove svelte">
          <svg viewBox="0 0 24 24" width="0.9em" height="0.9em" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round">…</svg>
        </button>
      </li>
      <li class="chip chip-soft chip-primary">
        css
        <button type="button" class="chips-input-remove" aria-label="Remove css">
          <svg viewBox="0 0 24 24" width="0.9em" height="0.9em" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round">…</svg>
        </button>
      </li>
    </ul>
    <input type="hidden" name="tags[]" value="svelte">
    <input type="hidden" name="tags[]" value="css">
  </div>
  <small>["svelte","css"]</small>
</div>
```

### With a combobox

```html
<div>
  <div class="chips-input">
    <div class="combobox">
      <label class="input">
        <input placeholder="City" type="text" role="combobox" value="" autocomplete="off" data-1p-ignore="true" data-lpignore="true" data-bwignore="true" data-form-type="other" aria-autocomplete="list" aria-expanded="false" aria-controls="s1-list">
      </label>
      <select hidden="" aria-hidden="true" tabindex="-1"></select>
    </div>
    <ul class="chips-input-list"></ul>
  </div>
</div>
```

### With a select

```html
<div>
  <div class="chips-input chips-input-end">
    <select class="select">
      <option disabled="" hidden="" selected="">Colour</option>
      <option value="Red">Red</option>
      <option value="Green">Green</option>
      <option value="Blue">Blue</option>
    </select>
    <ul class="chips-input-list">
      <li class="chip chip-outline">
        Red
        <button type="button" class="chips-input-remove" aria-label="Remove Red">
          <svg viewBox="0 0 24 24" width="0.9em" height="0.9em" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round">…</svg>
        </button>
      </li>
    </ul>
  </div>
</div>
```

### List above

```html
<div>
  <div class="chips-input chips-input-top">
    <input class="input" value="" placeholder="Add a label">
    <ul class="chips-input-list">
      <li class="chip chip-primary">
        design
        <button type="button" class="chips-input-remove" aria-label="Remove design">
          <svg viewBox="0 0 24 24" width="0.9em" height="0.9em" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round">…</svg>
        </button>
      </li>
      <li class="chip chip-primary">
        ui
        <button type="button" class="chips-input-remove" aria-label="Remove ui">
          <svg viewBox="0 0 24 24" width="0.9em" height="0.9em" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round">…</svg>
        </button>
      </li>
    </ul>
  </div>
</div>
```


---

# Editable

A value shown as it is, that turns into its editor when asked: a click, Enter or F2. Enter keeps the edit (Ctrl + Enter in a multi-line field), Escape drops it, leaving the editor keeps it. The editor is a snippet, or the one `kind` names for a plain value. The component keeps no value: `onvalue` hands the new one to its owner.

- Group: Form
- Namespaces: `editable`
- Svelte: `<Editable>`
- Reference SCSS: [cosmos](reference/cosmos/editable.scss), [dahlia](reference/dahlia/editable.scss), [daisy](reference/daisy/editable.scss), [peony](reference/peony/editable.scss), [sunflower](reference/sunflower/editable.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.editable` | root | all | The component itself. |
| `.editable-display` | part | all | The value at rest: a button that opens the editor — or plain text when `openOn` is empty. |
| `.editable-empty` | part | all | The placeholder of an empty value. |
| `.editable-form` | part | all | The frame around the editor. |
| `.editable-list` | part | all | The row of checkboxes of a boolean list. |
| `.editable-lg` | axis size | all | Sets size to “lg”. |
| `.editable-md` | axis size | all | Sets size to “md”. |
| `.editable-sm` | axis size | all | Sets size to “sm”. |
| `.editable-xl` | axis size | all | Sets size to “xl”. |
| `.editable-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.editable-display`: `:disabled` `:focus-visible`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### By the shape of the value

```html
<dl>
  <dt>text</dt>
  <dd>
    <div class="editable">
      <button type="button" class="editable-display" aria-label="Deployment, Edit">Deployment</button>
    </div>
  </dd>
  <dt>number</dt>
  <dd>
    <div class="editable">
      <button type="button" class="editable-display" aria-label="12, Edit">12</button>
    </div>
  </dd>
  <dt>boolean</dt>
  <dd>
    <div class="editable">
      <button type="button" class="editable-display" aria-label="Yes, Edit">Yes</button>
    </div>
  </dd>
  <dt>text[]</dt>
  <dd>
    <div class="editable">
      <button type="button" class="editable-display" aria-label="eu-west, canary, Edit">eu-west, canary</button>
    </div>
  </dd>
  <dt>number[]</dt>
  <dd>
    <div class="editable">
      <button type="button" class="editable-display" aria-label="2, 4, 8, Edit">2, 4, 8</button>
    </div>
  </dd>
  <dt>boolean[]</dt>
  <dd>
    <div class="editable">
      <button type="button" class="editable-display" aria-label="Yes, No, Yes, Edit">Yes, No, Yes</button>
    </div>
  </dd>
  <dt>empty</dt>
  <dd>
    <div class="editable">
      <button type="button" class="editable-display" aria-label="Add a note, Edit">
        <span class="editable-empty">Add a note</span>
      </button>
    </div>
  </dd>
</dl>
```

### Your own display and editor

```html
<div>
  <div class="editable">
    <button type="button" class="editable-display" aria-label="live, Edit">
      <div color="success" class="badge">live</div>
    </button>
  </div>
  <div class="editable">
    <button type="button" class="editable-display" aria-label="Add a note, Edit">
      <span class="editable-empty">Add a note</span>
    </button>
  </div>
</div>
```

### Opened from outside

```html
<div>
  <div>
    <div class="editable">
      <span class="editable-display">Lyon</span>
    </div>
    <button class="btn btn-sm">✎ Edit</button>
  </div>
  <div>
    <span>First name</span>
    <div class="editable">
      <span class="editable-display">Ada</span>
    </div>
    <span>Last name</span>
    <div class="editable">
      <span class="editable-display">Lovelace</span>
    </div>
  </div>
  <button class="btn btn-primary">Edit profile</button>
</div>
```


---

# Label

Inline text naming a control — on its own, or inside a field as a prefix or a suffix (.input > .label). The label that floats into a field's frame is floating-label, a different component (ADR 0009).

- Group: Form layout
- Namespaces: `label`
- Svelte: `<Label>`
- Reference SCSS: [cosmos](reference/cosmos/label.scss), [dahlia](reference/dahlia/label.scss), [daisy](reference/daisy/label.scss), [peony](reference/peony/label.scss), [sunflower](reference/sunflower/label.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.label` | root | all | The component itself. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Naming a control

```html
<label class="label">
  <input type="checkbox" class="checkbox">
  Remember me
</label>
```

### Inside a field

```html
<label class="input">
  <span class="label">https://</span>
  <input placeholder="your-site.com">
</label>
<label class="input">
  <input placeholder="Amount">
  <span class="label">EUR</span>
</label>
```


---

# Floating label

A container that wraps a field: its <span> sits over the frame and rises out of the way once the field has content. Unlike label, which sits inside a field, this one goes around it.

- Group: Form layout
- Namespaces: `floating-label`
- Svelte: `<FloatingLabel>`
- Reference SCSS: [cosmos](reference/cosmos/floating-label.scss), [dahlia](reference/dahlia/floating-label.scss), [daisy](reference/daisy/floating-label.scss), [peony](reference/peony/floating-label.scss), [sunflower](reference/sunflower/floating-label.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.floating-label` | root | all | The component itself. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.floating-label`: `:focus-within`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### A label that floats

```html
<label class="floating-label">
  <span>Email</span>
  <input type="email" placeholder="Email" class="input">
</label>
<label class="floating-label">
  <span>Message</span>
  <textarea placeholder="Message" class="textarea"></textarea>
</label>
```

### It follows the field's size

```html
<label class="floating-label">
  <span>Small</span>
  <input placeholder="Small" class="input input-sm">
</label>
<label class="floating-label">
  <span>Large</span>
  <input placeholder="Large" class="input input-lg">
</label>
```


---

# Fieldset

A group of related fields with a legend. It is the frame around a form section, not a field itself.

- Group: Form layout
- Namespaces: `fieldset`
- Svelte: `<Fieldset>`
- Reference SCSS: [cosmos](reference/cosmos/fieldset.scss), [dahlia](reference/dahlia/fieldset.scss), [daisy](reference/daisy/fieldset.scss), [peony](reference/peony/fieldset.scss), [sunflower](reference/sunflower/fieldset.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.fieldset` | root | all | The component itself. |
| `.fieldset-label` | part | all | A caption under the group, for a hint or an error. |
| `.fieldset-legend` | part | all | The group's heading. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### A group of fields

```html
<fieldset class="fieldset">
  <legend class="fieldset-legend">Shipping</legend>
  <input placeholder="Street" class="input">
  <input placeholder="City" class="input">
  <p class="fieldset-label">We only ship within the EU.</p>
</fieldset>
```


---

# Validator

Marks a field as validated: the field paints itself from its own :valid / :invalid state, and the hint appears only when it is wrong. No Svelte wrapper — it is a class on the field, plus the validator and hint props the field components carry.

- Group: Form layout
- Namespaces: `validator`
- Svelte: no wrapper; the classes are written by hand
- Reference SCSS: [cosmos](reference/cosmos/validator.scss), [dahlia](reference/dahlia/validator.scss), [daisy](reference/daisy/validator.scss), [peony](reference/peony/validator.scss), [sunflower](reference/sunflower/validator.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.validator` | plain class | all |  |
| `.validator-hint` | plain class | all | The message shown when the field it follows is invalid. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.validator`: `:checked` `:focus` `:focus-within` `:user-invalid` `:user-valid` `[aria-checked=true]` `[aria-invalid=false]` `[aria-invalid]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Email

```html
<fieldset class="fieldset">
  <legend class="fieldset-legend">Email</legend>
  <input type="email" required="" placeholder="name@example.com" class="input validator">
  <p class="validator-hint">Enter a valid email address</p>
</fieldset>
```


---

# Text

The typographic scale, delivered as classes — no frame, no state. Three components in one file, `text`, `title` and `subtitle`, because separating them would buy nothing. Size and weight are two axes, and each of the three carries the eight semantic colours.

- Group: Display
- Namespaces: `text`, `title`, `subtitle`
- Svelte: `<Subtitle>`, `<Text>`, `<Title>`
- Reference SCSS: [cosmos](reference/cosmos/text.scss), [dahlia](reference/dahlia/text.scss), [daisy](reference/daisy/text.scss), [peony](reference/peony/text.scss), [sunflower](reference/sunflower/text.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.subtitle` | root | none yet | The component itself. |
| `.text` | root | none yet | The component itself. |
| `.title` | root | all | The page's one title. |
| `.subtitle-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.subtitle-error` | axis color | all | Sets color to “error”. |
| `.subtitle-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.subtitle-neutral` | axis color | all | Sets color to “neutral”. |
| `.subtitle-primary` | axis color | all | Sets color to “primary”. |
| `.subtitle-s1` | axis s | all | A subtitle, first step down from the title. |
| `.subtitle-s2` | axis s | all | A subtitle, second step down. |
| `.subtitle-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.subtitle-success` | axis color | all | Sets color to “success”. |
| `.subtitle-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.text-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.text-b1` | axis b | all | Weight 1. |
| `.text-b2` | axis b | all | Weight 2. |
| `.text-b3` | axis b | all | Weight 3. |
| `.text-error` | axis color | all | Sets color to “error”. |
| `.text-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.text-neutral` | axis color | all | Sets color to “neutral”. |
| `.text-primary` | axis color | all | Sets color to “primary”. |
| `.text-s1` | axis s | all | Size step 1, with its leading. |
| `.text-s2` | axis s | all | Size step 2, with its leading. |
| `.text-s3` | axis s | all | Size step 3, with its leading. |
| `.text-s4` | axis s | all | Size step 4, with its leading. |
| `.text-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.text-success` | axis color | all | Sets color to “success”. |
| `.text-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.title-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.title-error` | axis color | all | Sets color to “error”. |
| `.title-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.title-neutral` | axis color | all | Sets color to “neutral”. |
| `.title-primary` | axis color | all | Sets color to “primary”. |
| `.title-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.title-success` | axis color | all | Sets color to “success”. |
| `.title-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Headings

```html
<div>
  <h1 class="title">Title</h1>
  <h2 class="subtitle-s1">Subtitle s1</h2>
  <h3 class="subtitle-s2">Subtitle s2</h3>
</div>
```

### Body

```html
<div>
  <p class="text-s2 text-b1">Base, semibold</p>
  <p class="text-s2 text-b2">Base, medium</p>
  <p class="text-s2 text-b3">Base, regular</p>
  <p class="text-s4 text-b3">Smallest step</p>
</div>
```

### Colour

```html
<div>
  <h1 class="title title-primary">Primary title</h1>
  <h2 class="subtitle-s1 subtitle-secondary">Secondary subtitle</h2>
  <p class="text-s2 text-b3 text-error">An error, in words.</p>
</div>
```


---

# Avatar

A picture, or a few letters, standing for someone — cropped to a shape. `.avatar` is the frame; its one child, an image or a span of initials, fills it.

- Group: Display
- Namespaces: `avatar`
- Svelte: `<Avatar>`
- Reference SCSS: [cosmos](reference/cosmos/avatar.scss), [dahlia](reference/dahlia/avatar.scss), [daisy](reference/daisy/avatar.scss), [peony](reference/peony/avatar.scss), [sunflower](reference/sunflower/avatar.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.avatar` | root | all | The component itself. |
| `.avatar-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.avatar-error` | axis color | all | Sets color to “error”. |
| `.avatar-hexagon` | axis shape | daisy | daisyUI’s hexagon mask. |
| `.avatar-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.avatar-lg` | axis size | all | Sets size to “lg”. |
| `.avatar-md` | axis size | all | Sets size to “md”. |
| `.avatar-neutral` | axis color | all | Sets color to “neutral”. |
| `.avatar-primary` | axis color | all | Sets color to “primary”. |
| `.avatar-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.avatar-sm` | axis size | all | Sets size to “sm”. |
| `.avatar-square` | axis shape | all | A box with the family’s box radius instead of a circle. |
| `.avatar-squircle` | axis shape | daisy | daisyUI’s squircle mask. |
| `.avatar-success` | axis color | all | Sets color to “success”. |
| `.avatar-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.avatar-xl` | axis size | all | Sets size to “xl”. |
| `.avatar-xs` | axis size | all | Sets size to “xs”. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Avatar>`: `--avatar-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Picture or initials

```html
<div class="avatar">
  <img src="…" alt="Ada">
</div>
<div class="avatar">
  <span>AL</span>
</div>
```

### Contour

```html
<div class="avatar avatar-primary">
  <img src="…" alt="">
</div>
<div class="avatar avatar-secondary">
  <img src="…" alt="">
</div>
<div class="avatar avatar-success">
  <span>GV</span>
</div>
<div class="avatar avatar-error">
  <span>ER</span>
</div>
```

### Sizes

```html
<div class="avatar avatar-xs">
  <span>XS</span>
</div>
<div class="avatar avatar-sm">
  <span>SM</span>
</div>
<div class="avatar avatar-md">
  <span>MD</span>
</div>
<div class="avatar avatar-lg">
  <span>LG</span>
</div>
<div class="avatar avatar-xl">
  <span>XL</span>
</div>
<div style="--avatar-size: 6rem" class="avatar">
  <img src="…" alt="">
</div>
```

### Shapes

```html
<div class="avatar avatar-xl avatar-square">
  <img src="…" alt="">
</div>
<div class="avatar avatar-primary avatar-xl avatar-square">
  <span>SQ</span>
</div>
```

### Masks

```html
<div class="avatar avatar-xl avatar-squircle">
  <img src="…" alt="">
</div>
<div class="avatar avatar-accent avatar-xl avatar-squircle">
  <img src="…" alt="">
</div>
<div class="avatar avatar-xl avatar-hexagon">
  <img src="…" alt="">
</div>
<div class="avatar avatar-primary avatar-xl avatar-hexagon">
  <img src="…" alt="">
</div>
```

### Badge

```html
<div class="badge badge-top badge-end">
  <div class="avatar avatar-xl">
    <img src="…" alt="">
  </div>
  <span class="chip">3</span>
</div>
<div class="badge badge-bottom badge-end">
  <div class="avatar avatar-primary avatar-xl">
    <span>GV</span>
  </div>
  <span class="chip">●</span>
</div>
<div class="badge badge-top badge-end">
  <div class="avatar avatar-xl avatar-square">
    <img src="…" alt="">
  </div>
  <span class="chip">new</span>
</div>
```


---

# Badge

A count or a mark pinned to another element. It has no life of its own — what it marks is the thing it sits on.

- Group: Display
- Namespaces: `badge`
- Svelte: `<Badge>`
- Reference SCSS: [cosmos](reference/cosmos/badge.scss), [dahlia](reference/dahlia/badge.scss), [daisy](reference/daisy/badge.scss), [peony](reference/peony/badge.scss), [sunflower](reference/sunflower/badge.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.badge` | root | all | The component itself. |
| `.badge-bottom` | axis side | all | Sets side to “bottom”. |
| `.badge-center` | axis align | all | Sets align to “center”. |
| `.badge-end` | axis align | all | Sets align to “end”. |
| `.badge-middle` | axis side | all | Sets side to “middle”. |
| `.badge-start` | axis align | all | Sets align to “start”. |
| `.badge-top` | axis side | all | Sets side to “top”. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Indicator

```html
<div class="badge badge-end badge-top">
  <button class="btn">Notifications</button>
  <span class="chip">99+</span>
</div>
```

### Positions

```html
<div class="badge badge-start badge-top">
  <button class="btn btn-primary">Start</button>
  <span class="chip">new</span>
</div>
<div class="badge badge-end badge-bottom">
  <button class="btn">Bottom</button>
  <span class="chip">✓</span>
</div>
```


---

# Chip

A small standalone token: a status, a tag, a removable value. Distinct from badge, which attaches to something else.

- Group: Display
- Namespaces: `chip`
- Svelte: `<Chip>`
- Reference SCSS: [cosmos](reference/cosmos/chip.scss), [dahlia](reference/dahlia/chip.scss), [daisy](reference/daisy/chip.scss), [peony](reference/peony/chip.scss), [sunflower](reference/sunflower/chip.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.chip` | root | all | The component itself. |
| `.chip-remove` | part | all | A piece the component draws; never opted into. |
| `.chip-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.chip-dash` | axis variant | all | Sets variant to “dash”. |
| `.chip-error` | axis color | all | Sets color to “error”. |
| `.chip-ghost` | axis variant | all | Sets variant to “ghost”. |
| `.chip-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.chip-lg` | axis size | all | Sets size to “lg”. |
| `.chip-md` | axis size | all | Sets size to “md”. |
| `.chip-neutral` | axis color | all | Sets color to “neutral”. |
| `.chip-outline` | axis variant | all | Sets variant to “outline”. |
| `.chip-primary` | axis color | all | Sets color to “primary”. |
| `.chip-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.chip-sm` | axis size | all | Sets size to “sm”. |
| `.chip-soft` | axis variant | all | Sets variant to “soft”. |
| `.chip-success` | axis color | all | Sets color to “success”. |
| `.chip-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.chip-xl` | axis size | all | Sets size to “xl”. |
| `.chip-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.chip-remove`: `:disabled` `:focus-visible` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Chip>`: `--chip-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Sizes

```html
<span class="chip chip-xs">Xsmall</span>
<span class="chip chip-sm">Small</span>
<span class="chip">Medium</span>
<span class="chip chip-lg">Large</span>
```

### Colors

```html
<span class="chip chip-primary">Primary</span>
<span class="chip chip-secondary">Secondary</span>
<span class="chip chip-accent">Accent</span>
<span class="chip chip-info">Info</span>
<span class="chip chip-success">Success</span>
<span class="chip chip-warning">Warning</span>
<span class="chip chip-error">Error</span>
```

### Variants

```html
<span class="chip chip-primary chip-soft">Soft</span>
<span class="chip chip-primary chip-outline">Outline</span>
<span class="chip chip-primary chip-dash">Dash</span>
<span class="chip chip-ghost">Ghost</span>
```


---

# Swatch

A sample of one colour, passed in as --swatch-color. The colour is data written at the call site, never a theme value.

- Group: Display
- Namespaces: `swatch`
- Svelte: `<Swatch>`
- Reference SCSS: [cosmos](reference/cosmos/swatch.scss), [dahlia](reference/dahlia/swatch.scss), [daisy](reference/daisy/swatch.scss), [peony](reference/peony/swatch.scss), [sunflower](reference/sunflower/swatch.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.swatch` | root | all | The component itself. |
| `.swatch-disabled` | part | all | A piece the component draws; never opted into. |
| `.swatch-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.swatch-circle` | axis shape | all | Sets shape to “circle”. |
| `.swatch-error` | axis color | all | Sets color to “error”. |
| `.swatch-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.swatch-lg` | axis size | all | Sets size to “lg”. |
| `.swatch-md` | axis size | all | Sets size to “md”. |
| `.swatch-neutral` | axis color | all | Sets color to “neutral”. |
| `.swatch-primary` | axis color | all | Sets color to “primary”. |
| `.swatch-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.swatch-sm` | axis size | all | Sets size to “sm”. |
| `.swatch-success` | axis color | all | Sets color to “success”. |
| `.swatch-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.swatch-xl` | axis size | all | Sets size to “xl”. |
| `.swatch-xs` | axis size | all | Sets size to “xs”. |
| `.swatch-active` | flag (active) | all | Written by the active prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.swatch`: `:disabled` `:focus-visible` `[disabled]` `[role=button]` `[tabindex]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Swatch>`: `--swatch-color`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Swatch

```html
<span class="swatch" style="--swatch-color: #1677ff"></span>
<span class="swatch" style="--swatch-color: #ffdc58">A</span>
<span class="swatch swatch-circle" style="--swatch-color: #171717">B</span>
```

### On-colour

```html
<span class="swatch" style="--swatch-color: #fafafa">A</span>
<span class="swatch" style="--swatch-color: #4ade80">A</span>
<span class="swatch" style="--swatch-color: #7dd3fc">A</span>
<span class="swatch" style="--swatch-color: #7c3aed">A</span>
<span class="swatch" style="--swatch-color: #171717">A</span>
```

### Transparency and selection

```html
<span class="swatch" style="--swatch-color: #0000"></span>
<span class="swatch" style="--swatch-color: #1677ff80"></span>
<span class="swatch swatch-active" style="--swatch-color: #4ade80"></span>
<span class="swatch swatch-disabled" aria-disabled="true" style="--swatch-color: #4ade80"></span>
```

### Semantic colours

```html
<span class="swatch swatch-primary"></span>
<span class="swatch swatch-secondary"></span>
<span class="swatch swatch-accent"></span>
<span class="swatch swatch-neutral"></span>
<span class="swatch swatch-info"></span>
<span class="swatch swatch-success"></span>
<span class="swatch swatch-warning"></span>
<span class="swatch swatch-error"></span>
```

### Sizes

```html
<span class="swatch swatch-xs" style="--swatch-color: #f87171"></span>
<span class="swatch swatch-sm" style="--swatch-color: #f87171"></span>
<span class="swatch swatch-md" style="--swatch-color: #f87171"></span>
<span class="swatch swatch-lg" style="--swatch-color: #f87171"></span>
<span class="swatch swatch-xl" style="--swatch-color: #f87171"></span>
```


---

# Bubble

A chat message: one class on one block, which gives it a fill, an ink and a tail at the bottom of one side. The tail is drawn in CSS, and each family draws its own.

- Group: Display
- Namespaces: `bubble`
- Svelte: `<Bubble>`
- Reference SCSS: [cosmos](reference/cosmos/bubble.scss), [dahlia](reference/dahlia/bubble.scss), [daisy](reference/daisy/bubble.scss), [peony](reference/peony/bubble.scss), [sunflower](reference/sunflower/bubble.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.bubble` | root | all | The component itself. |
| `.bubble-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.bubble-error` | axis color | all | Sets color to “error”. |
| `.bubble-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.bubble-lg` | axis size | all | Sets size to “lg”. |
| `.bubble-md` | axis size | all | Sets size to “md”. |
| `.bubble-neutral` | axis color | all | Sets color to “neutral”. |
| `.bubble-primary` | axis color | all | Sets color to “primary”. |
| `.bubble-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.bubble-sm` | axis size | all | Sets size to “sm”. |
| `.bubble-success` | axis color | all | Sets color to “success”. |
| `.bubble-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.bubble-xl` | axis size | all | Sets size to “xl”. |
| `.bubble-xs` | axis size | all | Sets size to “xs”. |
| `.bubble-end` | flag (end) | all | Puts the tail on the end side, and the bubble at the end of the line. |
| `.bubble-no-tail` | flag (noTail) | all | Drops the tail but keeps its room, so a follow-up message stays in the column. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Bubble>`: `--bubble-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Conversation

```html
<div>
  <div class="bubble bubble-no-tail">Did you see the new family?</div>
  <div class="bubble">The yellow one.</div>
  <div class="bubble bubble-primary bubble-end bubble-no-tail">The one with the hard shadow?</div>
  <div class="bubble bubble-primary bubble-end">It pushes into its own shadow when you press it.</div>
  <div class="bubble">That one.</div>
</div>
```

### Colours

```html
<div>
  <div class="bubble bubble-neutral">Neutral</div>
  <div class="bubble bubble-secondary">Secondary</div>
  <div class="bubble bubble-accent">Accent</div>
  <div class="bubble bubble-info bubble-end">Info</div>
  <div class="bubble bubble-success bubble-end">Success</div>
  <div class="bubble bubble-warning bubble-end">Warning</div>
  <div class="bubble bubble-error bubble-end">Error</div>
</div>
```

### Sizes

```html
<div>
  <div class="bubble bubble-xs">Extra small</div>
  <div class="bubble bubble-sm">Small</div>
  <div class="bubble bubble-lg">Large</div>
  <div class="bubble bubble-xl">Extra large</div>
</div>
```


---

# Card

A box with, optionally, a figure, a title, a body and a row of actions. Every part is optional: a card with nothing but a body is a card, and that is the common case.

- Group: Display
- Namespaces: `card`
- Svelte: `<Card>`
- Reference SCSS: [cosmos](reference/cosmos/card.scss), [dahlia](reference/dahlia/card.scss), [daisy](reference/daisy/card.scss), [peony](reference/peony/card.scss), [sunflower](reference/sunflower/card.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.card` | root | all | The component itself. |
| `.card-actions` | part | all | A wrapping row of buttons at the end of the body. |
| `.card-body` | part | all | The padded column that holds everything but the figure. |
| `.card-title` | part | all | The heading, in the family’s title ink and weight. |
| `.card-lg` | axis size | all | Sets size to “lg”. |
| `.card-md` | axis size | all | Sets size to “md”. |
| `.card-sm` | axis size | all | Sets size to “sm”. |
| `.card-xl` | axis size | all | Sets size to “xl”. |
| `.card-xs` | axis size | all | Sets size to “xs”. |
| `.card-border` | flag (border) | all | Draws an edge the family does not draw by default. |
| `.card-dash` | flag (dash) | all | The same edge, dashed. |
| `.card-image-full` | flag (imageFull) | all | Lets the figure fill the card, with the body laid over it. |
| `.card-side` | flag (side) | all | Puts the figure beside the body instead of above it. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Card>`: `--card-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Plain

```html
<div class="card">
  <div class="card-body">
    <h2 class="card-title">Card title</h2>
    <p>A card holds one idea and the actions it offers.</p>
    <div class="card-actions">
      <button class="btn btn-primary">Buy now</button>
    </div>
  </div>
</div>
```

### Figure

```html
<div class="card">
  <figure>
    <img src="…" alt="">
  </figure>
  <div class="card-body">
    <h2 class="card-title">With a figure</h2>
    <p>The image follows the card's corners.</p>
  </div>
</div>
```

### Flags

```html
<div class="card card-border">
  <div class="card-body">
    <h2 class="card-title">Border</h2>
    <p>An explicit edge.</p>
  </div>
</div>
<div class="card card-dash">
  <div class="card-body">
    <h2 class="card-title">Dash</h2>
    <p>A dashed edge.</p>
  </div>
</div>
<div class="card card-side">
  <figure>
    <img src="…" alt="">
  </figure>
  <div class="card-body">
    <h2 class="card-title">Side</h2>
    <p>Figure beside the body.</p>
  </div>
</div>
<div class="card card-image-full">
  <figure>
    <img src="…" alt="">
  </figure>
  <div class="card-body">
    <h2 class="card-title">Image full</h2>
    <p>The body sits over the figure.</p>
  </div>
</div>
```

### Background

```html
<div class="card" style="--card-bg: #efb">
  <div class="card-body">
    <h2 class="card-title">Background</h2>
    <p>Written into --card-bg.</p>
  </div>
</div>
```


---

# Stat

A figure worth a glance — a title, a value, a description, and optionally a figure on the side and actions. A box like a card, laid out as a two-column grid. `.stats` lines several up in one frame, a divider between each.

- Group: Display
- Namespaces: `stat`, `stats`
- Svelte: `<Stat>`, `<Stats>`
- Reference SCSS: [cosmos](reference/cosmos/stat.scss), [dahlia](reference/dahlia/stat.scss), [daisy](reference/daisy/stat.scss), [peony](reference/peony/stat.scss), [sunflower](reference/sunflower/stat.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.stat` | root | all | The component itself. |
| `.stats` | root | all | One frame for several stats; the stats inside put their own frame down. |
| `.stat-actions` | part | all | A wrapping row of buttons under the text. |
| `.stat-desc` | part | all | A line under the value, in the muted ink. |
| `.stat-figure` | part | all | An icon or a picture in the second column, across the text rows. |
| `.stat-title` | part | all | The small label above the value, in the muted ink. |
| `.stat-value` | part | all | The number, large and heavy. |
| `.stat-lg` | axis size | all | Sets size to “lg”. |
| `.stat-md` | axis size | all | Sets size to “md”. |
| `.stat-sm` | axis size | all | Sets size to “sm”. |
| `.stat-xl` | axis size | all | Sets size to “xl”. |
| `.stat-xs` | axis size | all | Sets size to “xs”. |
| `.stats-horizontal` | axis direction | all | A row (the default). |
| `.stats-vertical` | axis direction | all | A column. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Stat>`: `--stat-bg`
- `<Stats>`: `--stats-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Plain

```html
<div class="stat">
  <div class="stat-title">Total page views</div>
  <div class="stat-value">89,400</div>
  <div class="stat-desc">21% more than last month</div>
</div>
```

### Figure and actions

```html
<div class="stat">
  <div class="stat-figure">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">…</svg>
  </div>
  <div class="stat-title">Total likes</div>
  <div class="stat-value">25.6K</div>
  <div class="stat-desc">↗︎ 400 (22%)</div>
  <div class="stat-actions">
    <button class="btn btn-xs">Details</button>
  </div>
</div>
<div class="stat">
  <div class="stat-figure">
    <div class="avatar avatar-success avatar-lg">
      <span>GV</span>
    </div>
  </div>
  <div class="stat-title">Tasks done</div>
  <div class="stat-value">86%</div>
  <div class="stat-desc">31 tasks remaining</div>
</div>
```

### Stats

```html
<div class="stats">
  <div class="stat">  <!-- ×3 -->
    <div class="stat-title">Downloads</div>
    <div class="stat-value">31K</div>
    <div class="stat-desc">Jan 1st – Feb 1st</div>
  </div>
</div>
```

### Vertical

```html
<div class="stats stats-vertical">
  <div class="stat">  <!-- ×2 -->
    <div class="stat-title">Downloads</div>
    <div class="stat-value">31K</div>
    <div class="stat-desc">Jan 1st – Feb 1st</div>
  </div>
</div>
```


---

# Carousel

A row of items that scrolls and snaps natively, with optional arrows over it, upcoming items and a pagination under it. Items may differ in size: the carousel measures them. The Svelte component draws one item per entry of `items`; the index is never bound — `goto` / `prev` / `next` move, `onindex` tells (ADR 0011).

- Group: Display
- Namespaces: `carousel`
- Svelte: `<Carousel>`
- Reference SCSS: [cosmos](reference/cosmos/carousel.scss), [dahlia](reference/dahlia/carousel.scss), [daisy](reference/daisy/carousel.scss), [peony](reference/peony/carousel.scss), [sunflower](reference/sunflower/carousel.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.carousel` | root | all | The component itself. |
| `.carousel-item` | part | all | One item. As wide as the track, unless `--carousel-item-width` says otherwise (`auto`: the item sizes itself). |
| `.carousel-next` | part | all | The cell the next arrow is drawn in, over the end of the track. |
| `.carousel-pagination` | part | all | The cell under the track the pagination is drawn in. |
| `.carousel-prev` | part | all | The cell the previous arrow is drawn in, over the start of the track. |
| `.carousel-track` | part | all | The scrolling, snapping row. Focusable, so the arrow keys move through it. |
| `.carousel-upcoming` | part | all | The row of upcoming items under the track. |
| `.carousel-upcoming-item` | part | all | One upcoming item: a button drawing the item again at `--carousel-upcoming-size`. |
| `.carousel-center` | axis align | all | An item comes to rest in the middle — with several visible, the neighbours peek in. |
| `.carousel-end` | axis align | all | An item comes to rest at the end of the track. |
| `.carousel-start` | axis align | all | An item comes to rest at the start of the track. |
| `.carousel-vertical` | flag (vertical) | all | Items go up and down; the arrows sit at the top and the bottom. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.carousel-track`: `:focus-visible`
- `.carousel-upcoming-item`: `:focus-visible`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Carousel>`: Finishes a change of state once the family's transition on the element has run, as long as its CSS says — at once if it draws none.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Arrows and dots

```html
<div>
  <div class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Previous item" disabled="">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Next item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-pagination">
      <nav aria-label="Items" class="pagination pagination-dots">
        <button type="button" class="pagination-item" aria-label="1 / 4" aria-current="page">
          <span class="pagination-number">1</span>
        </button>
        <button type="button" class="pagination-item" aria-label="2 / 4">
          <span class="pagination-number">2</span>
        </button>
        <button type="button" class="pagination-item" aria-label="3 / 4">
          <span class="pagination-number">3</span>
        </button>
        <button type="button" class="pagination-item" aria-label="4 / 4">
          <span class="pagination-number">4</span>
        </button>
      </nav>
    </div>
  </div>
  <small>onindex: 0</small>
</div>
```

### Infinite

```html
<div>
  <div class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Previous item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Next item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-pagination">
      <nav aria-label="Items" class="pagination pagination-dots">
        <button type="button" class="pagination-item" aria-label="1 / 4" aria-current="page">
          <span class="pagination-number">1</span>
        </button>
        <button type="button" class="pagination-item" aria-label="2 / 4">
          <span class="pagination-number">2</span>
        </button>
        <button type="button" class="pagination-item" aria-label="3 / 4">
          <span class="pagination-number">3</span>
        </button>
        <button type="button" class="pagination-item" aria-label="4 / 4">
          <span class="pagination-number">4</span>
        </button>
      </nav>
    </div>
  </div>
</div>
```

### Loop

```html
<div>
  <div class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Previous item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Next item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
  </div>
</div>
```

### Upcoming

```html
<div>
  <div class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Previous item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Next item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-upcoming">
      <button type="button" class="carousel-upcoming-item" aria-label="2 / 4">
        <div>2. Noon</div>
      </button>
      <button type="button" class="carousel-upcoming-item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </button>
      <button type="button" class="carousel-upcoming-item" aria-label="4 / 4">
        <div>4. Night</div>
      </button>
    </div>
  </div>
</div>
```

### Snippets of your own

```html
<div>
  <div class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-sm">prev</button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-sm">next</button>
    </div>
    <div class="carousel-pagination">
      <nav class="pagination pagination-sm">
        <button type="button" class="pagination-item" aria-label="Previous page" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button type="button" class="pagination-item" aria-label="Page 1" aria-current="page">
          <span class="pagination-number">1</span>
        </button>
        <button type="button" class="pagination-item" aria-label="Page 2">
          <span class="pagination-number">2</span>
        </button>
        <button type="button" class="pagination-item" aria-label="Page 3">
          <span class="pagination-number">3</span>
        </button>
        <button type="button" class="pagination-item" aria-label="Page 4">
          <span class="pagination-number">4</span>
        </button>
        <button type="button" class="pagination-item" aria-label="Next page">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
      </nav>
    </div>
  </div>
</div>
```

### Driven from outside

```html
<div>
  <div class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
  </div>
  <nav class="pagination pagination-sm">
    <button type="button" class="pagination-item" aria-label="Previous page" disabled="">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 1" aria-current="page">
      <span class="pagination-number">1</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 2">
      <span class="pagination-number">2</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 3">
      <span class="pagination-number">3</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 4">
      <span class="pagination-number">4</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Next page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
  </nav>
</div>
```

### Several at once

```html
<div>
  <div style="--carousel-item-width: 70%; --carousel-item-gap: .5rem" class="carousel carousel-center" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-pagination">
      <nav aria-label="Items" class="pagination pagination-dots">
        <button type="button" class="pagination-item" aria-label="1 / 4" aria-current="page">
          <span class="pagination-number">1</span>
        </button>
        <button type="button" class="pagination-item" aria-label="2 / 4">
          <span class="pagination-number">2</span>
        </button>
        <button type="button" class="pagination-item" aria-label="3 / 4">
          <span class="pagination-number">3</span>
        </button>
        <button type="button" class="pagination-item" aria-label="4 / 4">
          <span class="pagination-number">4</span>
        </button>
      </nav>
    </div>
  </div>
</div>
```

### Items of different sizes

```html
<div>
  <div style="--carousel-item-width: auto; --carousel-item-gap: .5rem" class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>
          <div>1. Dawn</div>
        </div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>
          <div>2. Noon</div>
        </div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>
          <div>3. Dusk</div>
        </div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>
          <div>4. Night</div>
        </div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Previous item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Next item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
  </div>
</div>
```

### Interactions off

```html
<div>
  <div class="carousel" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="-1">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Previous item" disabled="">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Next item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
  </div>
</div>
```

### Vertical

```html
<div>
  <div style="--carousel-height: 12rem" class="carousel carousel-vertical" role="region" aria-roledescription="carousel">
    <div class="carousel-track" tabindex="0">
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="1 / 4">
        <div>1. Dawn</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="2 / 4">
        <div>2. Noon</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="3 / 4">
        <div>3. Dusk</div>
      </div>
      <div class="carousel-item" role="group" aria-roledescription="item" aria-label="4 / 4">
        <div>4. Night</div>
      </div>
    </div>
    <div class="carousel-prev">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Previous item" disabled="">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
    <div class="carousel-next">
      <button type="button" class="btn btn-circle btn-sm" aria-label="Next item">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
      </button>
    </div>
  </div>
</div>
```


---

# Alert

An inline message — information, success, warning, error — where it concerns the user. A toast is the same message, floating and temporary.

- Group: Feedback
- Namespaces: `alert`
- Svelte: `<Alert>`
- Reference SCSS: [cosmos](reference/cosmos/alert.scss), [dahlia](reference/dahlia/alert.scss), [daisy](reference/daisy/alert.scss), [peony](reference/peony/alert.scss), [sunflower](reference/sunflower/alert.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.alert` | root | all | A soft tint of its colour, an icon, a body, optional actions. |
| `.alert-actions` | part | all | Buttons on the trailing side. |
| `.alert-body` | part | all | The text, growing to fill the row. |
| `.alert-close` | part | all | The close button of a dismissible alert. |
| `.alert-icon` | part | all | The leading icon; takes the colour. |
| `.alert-title` | part | all | A bold first line. |
| `.alert-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.alert-error` | axis color | all | Sets color to “error”. |
| `.alert-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.alert-lg` | axis size | all | Sets size to “lg”. |
| `.alert-md` | axis size | all | Sets size to “md”. |
| `.alert-neutral` | axis color | all | Sets color to “neutral”. |
| `.alert-outline` | axis variant | all | Sets variant to “outline”. |
| `.alert-primary` | axis color | all | Sets color to “primary”. |
| `.alert-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.alert-sm` | axis size | all | Sets size to “sm”. |
| `.alert-solid` | axis variant | all | Sets variant to “solid”. |
| `.alert-success` | axis color | all | Sets color to “success”. |
| `.alert-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.alert-xl` | axis size | all | Sets size to “xl”. |
| `.alert-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.alert`: `[data-motion=leave]`
- `.alert-close`: `:focus-visible` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Alert>`: `--alert-bg` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Alert>`: `.alert` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<Alert>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Colors

```html
<div>
  <div class="alert" role="status">
    <div class="alert-body">A neutral note.</div>
  </div>
  <div class="alert alert-info" role="status">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">
      <p class="alert-title">Heads up</p>
      A new version is available.
    </div>
  </div>
  <div class="alert alert-success" role="status">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">Your changes are saved.</div>
  </div>
  <div class="alert alert-warning" role="alert">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">Your trial ends in 3 days.</div>
  </div>
  <div class="alert alert-error" role="alert">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">
      <p class="alert-title">Payment failed</p>
      Check your card details.
    </div>
  </div>
</div>
```

### Outline

```html
<div>
  <div class="alert alert-success alert-outline" role="status">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">Saved.</div>
  </div>
  <div class="alert alert-error alert-outline" role="alert">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">Something went wrong.</div>
  </div>
</div>
```

### Solid

```html
<div>
  <div class="alert alert-success alert-solid" role="status">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">Saved.</div>
  </div>
  <div class="alert alert-error alert-solid" role="alert">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">Something went wrong.</div>
  </div>
</div>
```

### Actions and dismiss

```html
<div>
  <div class="alert alert-info" role="status">
    <span class="alert-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </span>
    <div class="alert-body">Cookies keep the session alive.</div>
    <div class="alert-actions">
      <button class="btn btn-sm">Settings</button>
    </div>
    <button type="button" class="alert-close" aria-label="Dismiss">
      <svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round">…</svg>
    </button>
  </div>
</div>
```


---

# Toast

A stack of alerts that pile up, each leaving on its own. Bind the component and call add() to push one. In the flow by default; a side or an align pins it to a corner of the viewport.

- Group: Feedback
- Namespaces: `toast`
- Svelte: `<Toast>`
- Reference SCSS: [cosmos](reference/cosmos/toast.scss), [dahlia](reference/dahlia/toast.scss), [daisy](reference/daisy/toast.scss), [peony](reference/peony/toast.scss), [sunflower](reference/sunflower/toast.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.toast` | root | all | The stack of alerts, in the flow. With a side or an align class, pinned to that corner and letting clicks through around the alerts. |
| `.toast-item` | part | all | A piece the component draws; never opted into. |
| `.toast-bottom` | axis side | all | Sets side to “bottom”. |
| `.toast-center` | axis align | all | Sets align to “center”. |
| `.toast-end` | axis align | all | Sets align to “end”. |
| `.toast-start` | axis align | all | Sets align to “start”. |
| `.toast-top` | axis side | all | Sets side to “top”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.toast-item`: `[data-motion=enter]` `[data-motion=leave]` `[data-motion=move]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Toast>`: `--motion-dx` `--motion-dy` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Toast>`: `.toast-item` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<Toast>`: `.toast-item` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<Toast>`: `.toast-item` is marked `data-motion="move"` when the list reorders, `--motion-dx/dy` holding where it came from: the family plays it back from there.
- `<Toast>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.
- `<Toast>`: The `animate` prop hands the move to a Svelte animation instead (`flip`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### A stack

```html
<div>
  <div>
    <button class="btn">Plain</button>
    <button class="btn btn-success">Success</button>
    <button class="btn btn-error">Persistent error</button>
    <button class="btn">With action</button>
  </div>
  <section class="toast" aria-label="Notifications" aria-live="polite"></section>
</div>
```

### Pinned to a corner

```html
<section class="toast toast-bottom toast-end" aria-label="Notifications" aria-live="polite"></section>
<button class="btn">Notify</button>
```


---

# Loading

Work is in progress and there is no percentage to show. If there is one, that is progress.

- Group: Feedback
- Namespaces: `loading`
- Svelte: `<Loading>`
- Reference SCSS: [cosmos](reference/cosmos/loading.scss), [dahlia](reference/dahlia/loading.scss), [daisy](reference/daisy/loading.scss), [peony](reference/peony/loading.scss), [sunflower](reference/sunflower/loading.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.loading` | root | all | The component itself. |
| `.loading-ball` | axis variant | all | Sets variant to “ball”. |
| `.loading-bars` | axis variant | all | Sets variant to “bars”. |
| `.loading-dots` | axis variant | all | Sets variant to “dots”. |
| `.loading-infinity` | axis variant | all | Sets variant to “infinity”. |
| `.loading-lg` | axis size | all | Sets size to “lg”. |
| `.loading-md` | axis size | all | Sets size to “md”. |
| `.loading-ring` | axis variant | all | Sets variant to “ring”. |
| `.loading-sm` | axis size | all | Sets size to “sm”. |
| `.loading-spinner` | axis variant | all | Sets variant to “spinner”. |
| `.loading-xl` | axis size | all | Sets size to “xl”. |
| `.loading-xs` | axis size | all | Sets size to “xs”. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Types

```html
<span class="loading loading-spinner"></span>
<span class="loading loading-dots"></span>
<span class="loading loading-ring"></span>
<span class="loading loading-ball"></span>
<span class="loading loading-bars"></span>
<span class="loading loading-infinity"></span>
```

### Sizes

```html
<span class="loading loading-xs"></span>
<span class="loading loading-sm"></span>
<span class="loading"></span>
<span class="loading loading-lg"></span>
```


---

# Progress

How far along something is, on a line. The value is the element's own attribute, not a class.

- Group: Feedback
- Namespaces: `progress`
- Svelte: `<Progress>`
- Reference SCSS: [cosmos](reference/cosmos/progress.scss), [dahlia](reference/dahlia/progress.scss), [daisy](reference/daisy/progress.scss), [peony](reference/peony/progress.scss), [sunflower](reference/sunflower/progress.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.progress` | root | all | The component itself. |
| `.progress-segment` | part | all | One part of a segmented bar; --segment is its share, --segment-color its colour. |
| `.progress-segments` | part | all | Not a <progress>: a bar cut into parts, each as wide as its share of the whole (--segment). It stands for a split, not a progress. |
| `.progress-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.progress-error` | axis color | all | Sets color to “error”. |
| `.progress-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.progress-neutral` | axis color | all | Sets color to “neutral”. |
| `.progress-primary` | axis color | all | Sets color to “primary”. |
| `.progress-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.progress-success` | axis color | all | Sets color to “success”. |
| `.progress-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.progress`: `:indeterminate`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Progress>`: `--segment` `--segment-color`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Default

```html
<progress class="progress" value="40" max="100"></progress>
```

### Colors

```html
<progress class="progress progress-primary" value="60" max="100"></progress>
<progress class="progress progress-secondary" value="60" max="100"></progress>
<progress class="progress progress-success" value="60" max="100"></progress>
<progress class="progress progress-error" value="60" max="100"></progress>
```

### Segments

```html
<div class="progress progress-segments" role="img">
  <span class="progress-segment" title="Négociation" style="--segment: 9; --segment-color: var(--color-primary)"></span>
  <span class="progress-segment" title="Facturation" style="--segment: 6; --segment-color: var(--color-warning)"></span>
  <span class="progress-segment" title="Livraison" style="--segment: 7; --segment-color: var(--color-info)"></span>
</div>
```


---

# Radial progress

The same statement as progress, drawn as a ring, for when the number itself is the point.

- Group: Feedback
- Namespaces: `radial-progress`
- Svelte: `<RadialProgress>`
- Reference SCSS: [cosmos](reference/cosmos/radial-progress.scss), [dahlia](reference/dahlia/radial-progress.scss), [daisy](reference/daisy/radial-progress.scss), [peony](reference/peony/radial-progress.scss), [sunflower](reference/sunflower/radial-progress.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.radial-progress` | root | all | The component itself. |
| `.radial-progress-lg` | axis size | all | Sets size to “lg”. |
| `.radial-progress-md` | axis size | all | Sets size to “md”. |
| `.radial-progress-sm` | axis size | all | Sets size to “sm”. |
| `.radial-progress-xl` | axis size | all | Sets size to “xl”. |
| `.radial-progress-xs` | axis size | all | Sets size to “xs”. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<RadialProgress>`: `--value`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Values

```html
<div class="radial-progress" role="progressbar" aria-valuenow="25" style="--value: 25">25%</div>
<div class="radial-progress" role="progressbar" aria-valuenow="50" style="--value: 50">50%</div>
<div class="radial-progress" role="progressbar" aria-valuenow="75" style="--value: 75">75%</div>
<div class="radial-progress" role="progressbar" aria-valuenow="100" style="--value: 100">100%</div>
```

### Sizes &amp; colors

```html
<div style="--value: 70" class="radial-progress radial-progress-sm" role="progressbar" aria-valuenow="70">70%</div>
<div style="--value: 70" class="radial-progress" role="progressbar" aria-valuenow="70">70%</div>
<div style="--value: 70" class="radial-progress radial-progress-lg" role="progressbar" aria-valuenow="70">70%</div>
```


---

# Skeleton

The shape of content that has not arrived. It borrows the size of whatever it stands in for.

- Group: Feedback
- Namespaces: `skeleton`
- Svelte: `<Skeleton>`
- Reference SCSS: [cosmos](reference/cosmos/skeleton.scss), [dahlia](reference/dahlia/skeleton.scss), [daisy](reference/daisy/skeleton.scss), [peony](reference/peony/skeleton.scss), [sunflower](reference/sunflower/skeleton.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.skeleton` | root | all | The component itself. |
| `.skeleton-text` | axis variant | all | Sets variant to “text”. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Line

```html
<div class="skeleton"></div>
```

### Card

```html
<div>
  <div class="skeleton"></div>  <!-- ×4 -->
</div>
```


---

# Empty state

What to show when there is nothing: no results, an empty folder, a list not started yet. Made for the empty slot of Table, Grid and List.

- Group: Feedback
- Namespaces: `empty-state`
- Svelte: `<EmptyState>`
- Reference SCSS: [cosmos](reference/cosmos/empty-state.scss), [dahlia](reference/dahlia/empty-state.scss), [daisy](reference/daisy/empty-state.scss), [peony](reference/peony/empty-state.scss), [sunflower](reference/sunflower/empty-state.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.empty-state` | root | all | A centred column. |
| `.empty-state-actions` | part | all | The way out: buttons, links. |
| `.empty-state-body` | part | all | Why, or what to do. |
| `.empty-state-icon` | part | all | The illustration, in a disc. |
| `.empty-state-title` | part | all | What is empty. |
| `.empty-state-dashed` | axis variant | all | Sets variant to “dashed”. |
| `.empty-state-lg` | axis size | all | Sets size to “lg”. |
| `.empty-state-md` | axis size | all | Sets size to “md”. |
| `.empty-state-sm` | axis size | all | Sets size to “sm”. |
| `.empty-state-xl` | axis size | all | Sets size to “xl”. |
| `.empty-state-xs` | axis size | all | Sets size to “xs”. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Basic

```html
<div class="empty-state">
  <div class="empty-state-icon" aria-hidden="true">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">…</svg>
  </div>
  <p class="empty-state-title">No results</p>
  <p class="empty-state-body">Nothing matches “zebra”. Try another word.</p>
  <div class="empty-state-actions">
    <button class="btn">Clear search</button>
  </div>
</div>
```

### Dashed

```html
<div>
  <div class="empty-state empty-state-dashed">
    <div class="empty-state-icon" aria-hidden="true">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">…</svg>
    </div>
    <p class="empty-state-title">No files yet</p>
    <p class="empty-state-body">Drop files here to upload them.</p>
  </div>
</div>
```

### In a table

```html
<div>
  <div class="table-scroll">
    <table class="table">
      <thead>
        <tr class="table-head">
          <th class="table-cell" scope="col">Name</th>  <!-- ×2 -->
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="table-empty" colspan="2">
            <div class="empty-state empty-state-sm">
              <div class="empty-state-icon" aria-hidden="true">
                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">…</svg>
              </div>
              <p class="empty-state-title">No people</p>
              <p class="empty-state-body">Invite someone to get started.</p>
            </div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
```


---

# Data handler

The live state of one remote resource — the current page of rows, the total, the search, the sort, the filters, the selection, the unsaved edits and their history — and the requests that read and change it. It draws nothing: it hands itself to its children, and a Table, a Grid or a List draws its rows as if they were static.

- Group: Data
- Namespaces: none: it draws nothing, so a family has nothing to style
- Svelte: no wrapper; the classes are written by hand
- Reference SCSS: none: no family styles it

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### A handler and a table

```html
<div>
  <div>
    <input type="search" placeholder="Search" value="" class="input">
    <button class="btn" disabled="">Previous</button>
    <span>page 1 / …</span>
    <button class="btn" disabled="">Next</button>
    <button class="btn btn-error" disabled="">Delete</button>
  </div>
  <div class="table-scroll">
    <table class="table">
      <thead>
        <tr class="table-head">
          <th class="table-cell" scope="col"></th>
          <th class="table-cell" scope="col">Name</th>  <!-- ×4 -->
        </tr>
      </thead>
      <tbody></tbody>
    </table>
  </div>
</div>
```

### Editing, undo and redo

```html
<div>
  <div class="table-scroll">
    <table class="table">
      <thead>
        <tr class="table-head">
          <th class="table-cell" scope="col">Name</th>  <!-- ×2 -->
          <th class="table-cell" scope="col"></th>
        </tr>
      </thead>
      <tbody></tbody>
    </table>
  </div>
  <div>
    <button class="btn" disabled="">Undo</button>  <!-- ×3 -->
    <button class="btn btn-primary" disabled="">Save</button>
  </div>
</div>
```

### The handler, member by member

```html
<div class="table-scroll">
  <table class="table">
    <thead>
      <tr class="table-head">
        <th class="table-cell" scope="col">Member</th>  <!-- ×2 -->
      </tr>
    </thead>
    <tbody>
      <tr class="table-row">  <!-- ×16 -->
        <td class="table-cell">
          <code>rows</code>
        </td>
        <td class="table-cell">The rows of the current page. Each is { id, val…</td>
      </tr>
    </tbody>
  </table>
</div>
```

### Where the data comes from

```html
<p>
  <code>GET /api/people?role=admin,editor&amp;search=ada&amp;so…</code>
  answers
  <code>{ data, total }</code>
  .
  <br>
  <code>PATCH /api/people/p042</code>
  receives the changed fields.
  <br>
  <code>DELETE /api/people</code>
  receives the ids, as a JSON array.
</p>
```


---

# Data control

The controls of a data handler, around the view that shows its rows: filters, sort, search, page size, pagination, and actions on the selection or on the whole resource. Every one is optional, and an action only appears when the handler can do it.

- Group: Data
- Namespaces: `data-control`
- Svelte: `<DataControl>`
- Reference SCSS: [cosmos](reference/cosmos/data-control.scss), [dahlia](reference/dahlia/data-control.scss), [daisy](reference/daisy/data-control.scss), [peony](reference/peony/data-control.scss), [sunflower](reference/sunflower/data-control.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.data-control` | root | all | The component itself. |
| `.data-control-actions` | part | all | A piece the component draws; never opted into. |
| `.data-control-actions-end` | part | all | A piece the component draws; never opted into. |
| `.data-control-actions-start` | part | all | A piece the component draws; never opted into. |
| `.data-control-bar` | part | all | The row of controls above the view. |
| `.data-control-bar-left` | part | all | Its start: filters, sort, your left actions, search. |
| `.data-control-bar-right` | part | all | Its end: page size, selection count, built-in actions, your right actions. |
| `.data-control-body` | part | all | The view: a table, a grid, a list, a kanban. |
| `.data-control-count` | part | all | How many rows are selected. |
| `.data-control-editor` | part | all | The box a filter is edited in. |
| `.data-control-field` | part | all | A piece the component draws; never opted into. |
| `.data-control-field-label` | part | all | A piece the component draws; never opted into. |
| `.data-control-filter` | part | all | One filter: a chip that turns into its field when pressed, and a button that takes it off. |
| `.data-control-filter-remove` | part | all | The button that takes a filter off. |
| `.data-control-filters` | part | all | The row of filters on the page. |
| `.data-control-more` | part | all | A piece the component draws; never opted into. |
| `.data-control-page-options` | part | all | A piece the component draws; never opted into. |
| `.data-control-pagination` | part | all | The range and the pages, above or below the view. |
| `.data-control-range` | part | all | “1–10 / 124”. |
| `.data-control-search` | part | all | The search field. |
| `.data-control-total` | part | all | How many rows match, at the end of the filters. |
| `.data-control-boxed` | axis variant | all | Sets variant to “boxed”. |
| `.data-control-lg` | axis size | all | Sets size to “lg”. |
| `.data-control-md` | axis size | all | Sets size to “md”. |
| `.data-control-sm` | axis size | all | Sets size to “sm”. |
| `.data-control-xl` | axis size | all | Sets size to “xl”. |
| `.data-control-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.data-control-filter-remove`: `:hover`
- `.data-control-more`: `[data-motion=enter]` `[data-motion=leave]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<DataControl>`: `--data-control-bg` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<DataControl>`: `.data-control-more` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<DataControl>`: `.data-control-more` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<DataControl>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Around a table

```html
<div>
  <div class="data-control">
    <div class="data-control-bar">
      <div class="data-control-bar-left">
        <div class="dropdown dropdown-fixed">
          <button aria-expanded="false" aria-controls="s2-content" aria-haspopup="true" title="Filters" aria-label="Filters" class="btn btn-ghost">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
            Filters
          </button>
        </div>
        <div class="dropdown dropdown-fixed">
          <button aria-expanded="false" aria-controls="s3-content" aria-haspopup="true" title="Name, A–Z" aria-label="Sort" class="btn btn-ghost">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
            Name, A–Z
          </button>
        </div>
        <label class="input data-control-search">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
          <input type="search" placeholder="Search" aria-label="Search" value="">
        </label>
      </div>
      <div class="data-control-bar-right">
        <button title="Export" aria-label="Export" class="btn btn-square btn-soft" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <select aria-label="10 per page" class="select">
          <option disabled="" hidden=""></option>
          <option value="5">5 per page</option>
          <option value="10" selected="">10 per page</option>
          <option value="25">25 per page</option>
          <option value="50">50 per page</option>
          <option value="100">100 per page</option>
        </select>
        <button title="Undo" aria-label="Undo" class="btn btn-square btn-ghost" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button title="Redo" aria-label="Redo" class="btn btn-square btn-ghost" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button title="Discard changes" aria-label="Discard changes" class="btn btn-square btn-ghost" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button title="Save" aria-label="Save" class="btn btn-primary" disabled="">Save</button>
        <button title="Delete" aria-label="Delete" class="btn btn-error btn-square btn-soft" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button title="Add" aria-label="Add" class="btn btn-square btn-soft">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
      </div>
    </div>
    <div class="data-control-body">
      <div class="table-scroll">
        <table class="table">
          <thead>
            <tr class="table-head">
              <th class="table-cell table-sticky" scope="col"></th>
              <th class="table-cell table-sticky table-sticky-last" scope="col" aria-sort="ascending">
                <button type="button" class="table-sort">Name</button>
              </th>
              <th class="table-cell" scope="col">Email</th>  <!-- ×3 -->
              <th class="table-cell" scope="col" aria-sort="none">  <!-- ×2 -->
                <button type="button" class="table-sort">Score</button>
              </th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td class="table-empty" colspan="7">Nobody matches.</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <dialog class="dialog dialog-sm"></dialog>
  </div>
</div>
```

### Around a grid, boxed

```html
<div>
  <div class="data-control data-control-boxed">
    <div class="data-control-bar">
      <div class="data-control-bar-left">
        <div class="dropdown dropdown-fixed">
          <button aria-expanded="false" aria-controls="s7-content" aria-haspopup="true" title="Filters" aria-label="Filters" class="btn btn-ghost">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
            Filters
          </button>
        </div>
        <div class="dropdown dropdown-fixed">
          <button aria-expanded="false" aria-controls="s8-content" aria-haspopup="true" title="Name, A–Z" aria-label="Sort" class="btn btn-ghost">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
            Name, A–Z
          </button>
        </div>
        <label class="input data-control-search">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
          <input type="search" placeholder="Search" aria-label="Search" value="">
        </label>
      </div>
      <div class="data-control-bar-right">
        <select aria-label="6 per page" class="select">
          <option disabled="" hidden=""></option>
          <option value="6" selected="">6 per page</option>
          <option value="12">12 per page</option>
          <option value="24">24 per page</option>
        </select>
        <button title="Delete" aria-label="Delete" class="btn btn-error btn-square btn-soft" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
      </div>
    </div>
    <div class="data-control-body">
      <div class="grid grid-masonry"></div>
    </div>
    <dialog class="dialog dialog-sm"></dialog>
  </div>
</div>
```

### Around a list, with only a search

```html
<div>
  <div class="data-control">
    <div class="data-control-bar">
      <div class="data-control-bar-left">
        <label class="input data-control-search">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
          <input type="search" placeholder="Search" aria-label="Search" value="">
        </label>
      </div>
      <div class="data-control-bar-right">
        <button class="btn btn-sm">Refresh</button>
      </div>
    </div>
    <div class="data-control-body">
      <ul class="list"></ul>
    </div>
    <dialog class="dialog dialog-sm"></dialog>
  </div>
</div>
```


---

# Table

A real <table>. Columns are described once — width, sticky, sortable, hidden — and each cell is the column’s field, or what your snippet draws. Selection, sorting and loading are drawn from plain props: where the rows come from is not the table’s business.

- Group: Data
- Namespaces: `table`
- Svelte: `<Table>`
- Reference SCSS: [cosmos](reference/cosmos/table.scss), [dahlia](reference/dahlia/table.scss), [daisy](reference/daisy/table.scss), [peony](reference/peony/table.scss), [sunflower](reference/sunflower/table.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.table` | root | all | The component itself. |
| `.table-cell` | part | peony | A header or body cell. |
| `.table-empty` | part | all | The cell drawn in place of the rows when there are none. |
| `.table-head` | part | peony | The header row. |
| `.table-row` | part | all | A body row. |
| `.table-row-dirty` | part | all | A row whose key is in `dirty`: changed, not saved. |
| `.table-row-selected` | part | all | A row whose key is in `selected`. |
| `.table-scroll` | part | all | The box the table scrolls in, sideways and — with a maxHeight — down. |
| `.table-sort` | part | all | The button a sortable header holds. aria-sort on the cell draws the arrow. |
| `.table-sticky` | part | all | A cell of a sticky column, pinned to the start edge. |
| `.table-sticky-last` | part | all | A cell of the last sticky column, which draws the edge. |
| `.table-lg` | axis size | all | Sets size to “lg”. |
| `.table-md` | axis size | all | Sets size to “md”. |
| `.table-sm` | axis size | all | Sets size to “sm”. |
| `.table-xl` | axis size | all | Sets size to “xl”. |
| `.table-xs` | axis size | all | Sets size to “xs”. |
| `.table-hover` | flag (hover) | all | Written by the hover prop. |
| `.table-loading` | flag (loading) | all | Written by the loading prop. |
| `.table-pinned` | flag (pinned) | all | Written by the pinned prop. |
| `.table-zebra` | flag (zebra) | all | Written by the zebra prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.table-sort`: `:focus-visible` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Table>`: `--table-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Columns and rows

```html
<div class="table-scroll">
  <table class="table">
    <thead>
      <tr class="table-head">
        <th class="table-cell" scope="col">Planet</th>  <!-- ×3 -->
      </tr>
    </thead>
    <tbody>
      <tr class="table-row">  <!-- ×4 -->
        <td class="table-cell">Mercury</td>  <!-- ×3 -->
      </tr>
    </tbody>
  </table>
</div>
```

### Sticky columns, sorting, selection

```html
<div>
  <div class="table-scroll">
    <table class="table table-zebra table-hover">
      <thead>
        <tr class="table-head">
          <th class="table-cell table-sticky" scope="col"></th>
          <th class="table-cell table-sticky table-sticky-last" scope="col" aria-sort="none">
            <button type="button" class="table-sort">Planet</button>
          </th>
          <th class="table-cell" scope="col" aria-sort="none">  <!-- ×2 -->
            <button type="button" class="table-sort">Type</button>
          </th>
          <th class="table-cell" scope="col" aria-sort="descending">
            <button type="button" class="table-sort">Radius (km)</button>
          </th>
          <th class="table-cell" scope="col">Day</th>  <!-- ×2 -->
        </tr>
      </thead>
      <tbody>
        <tr class="table-row">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Jupiter" class="checkbox">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Jupiter</td>
          <td class="table-cell">Gas giant</td>  <!-- ×5 -->
        </tr>
        <tr class="table-row">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Saturn" class="checkbox">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Saturn</td>
          <td class="table-cell">Gas giant</td>  <!-- ×5 -->
        </tr>
        <tr class="table-row">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Uranus" class="checkbox">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Uranus</td>
          <td class="table-cell">Ice giant</td>  <!-- ×5 -->
        </tr>
        <tr class="table-row">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Neptune" class="checkbox">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Neptune</td>
          <td class="table-cell">Ice giant</td>  <!-- ×5 -->
        </tr>
        <tr class="table-row table-row-selected">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Earth" class="checkbox" checked="">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Earth</td>
          <td class="table-cell">Terrestrial</td>  <!-- ×5 -->
        </tr>
        <tr class="table-row">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Venus" class="checkbox">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Venus</td>
          <td class="table-cell">Terrestrial</td>  <!-- ×5 -->
        </tr>
        <tr class="table-row">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Mars" class="checkbox">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Mars</td>
          <td class="table-cell">Terrestrial</td>  <!-- ×5 -->
        </tr>
        <tr class="table-row">
          <td class="table-cell table-sticky">
            <input type="checkbox" aria-label="Select Mercury" class="checkbox">
          </td>
          <td class="table-cell table-sticky table-sticky-last">Mercury</td>
          <td class="table-cell">Terrestrial</td>  <!-- ×5 -->
        </tr>
      </tbody>
    </table>
  </div>
</div>
```

### A pinned head, loading, dirty rows

```html
<div class="table-scroll">
  <table class="table table-pinned">
    <thead>
      <tr class="table-head">
        <th class="table-cell" scope="col">Planet</th>  <!-- ×3 -->
      </tr>
    </thead>
    <tbody>
      <tr class="table-row">
        <td class="table-cell">Mercury</td>  <!-- ×3 -->
      </tr>
      <tr class="table-row table-row-dirty">
        <td class="table-cell">Venus</td>  <!-- ×3 -->
      </tr>
      <tr class="table-row">
        <td class="table-cell">Earth</td>  <!-- ×3 -->
      </tr>
      <tr class="table-row table-row-dirty">
        <td class="table-cell">Mars</td>  <!-- ×3 -->
      </tr>
      <tr class="table-row">  <!-- ×4 -->
        <td class="table-cell">Jupiter</td>  <!-- ×3 -->
      </tr>
    </tbody>
  </table>
</div>
<div class="table-scroll">
  <table class="table table-loading">
    <thead>
      <tr class="table-head">
        <th class="table-cell" scope="col">Planet</th>  <!-- ×3 -->
      </tr>
    </thead>
    <tbody>
      <tr class="table-row">  <!-- ×3 -->
        <td class="table-cell">Mercury</td>  <!-- ×3 -->
      </tr>
    </tbody>
  </table>
</div>
```

### Nothing to show

```html
<div class="table-scroll">
  <table class="table">
    <thead>
      <tr class="table-head">
        <th class="table-cell" scope="col">Planet</th>  <!-- ×3 -->
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="table-empty" colspan="3">No planet matches.</td>
      </tr>
    </tbody>
  </table>
</div>
```

### Editable in place

```html
<div class="table-scroll">
  <table class="table">
    <thead>
      <tr class="table-head">
        <th class="table-cell" scope="col">Planet</th>  <!-- ×3 -->
      </tr>
    </thead>
    <tbody>
      <tr class="table-row">
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="Earth, Edit">Earth</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="1, Edit">1</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="—, Edit">
              <span class="editable-empty">—</span>
            </button>
          </div>
        </td>
      </tr>
      <tr class="table-row">
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="Mars, Edit">Mars</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="2, Edit">2</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="—, Edit">
              <span class="editable-empty">—</span>
            </button>
          </div>
        </td>
      </tr>
      <tr class="table-row">
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="Jupiter, Edit">Jupiter</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="95, Edit">95</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="giant, Edit">giant</button>
          </div>
        </td>
      </tr>
      <tr class="table-row">
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="Saturn, Edit">Saturn</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="146, Edit">146</button>
          </div>
        </td>
        <td class="table-cell">
          <div class="editable">
            <button type="button" class="editable-display" aria-label="giant, Edit">giant</button>
          </div>
        </td>
      </tr>
    </tbody>
  </table>
</div>
```


---

# Grid

Items in as many columns as fit. A column is never narrower than the family’s minimum, so the count follows the width — and the size variant — never a breakpoint. What an item looks like is yours: a card, usually.

- Group: Data
- Namespaces: `grid`
- Svelte: `<Grid>`
- Reference SCSS: [cosmos](reference/cosmos/grid.scss), [dahlia](reference/dahlia/grid.scss), [daisy](reference/daisy/grid.scss), [peony](reference/peony/grid.scss), [sunflower](reference/sunflower/grid.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.grid` | root | all | The component itself. |
| `.grid-empty` | part | all | Drawn in place of the items when there are none. |
| `.grid-item` | part | all | One item. The component wraps each of yours in one. |
| `.grid-item-dirty` | part | all | An item whose key is in `dirty`: changed, not saved. |
| `.grid-item-selected` | part | all | An item whose key is in `selected`. |
| `.grid-lane` | part | all | Masonry: one column, stacking its items. |
| `.grid-masonry` | part | all | Masonry: the grid holds lanes instead of items. Written by the component, which deals the items. |
| `.grid-lg` | axis size | all | Sets size to “lg”. |
| `.grid-loose` | axis gap | all | Sets gap to “loose”. |
| `.grid-md` | axis size | all | Sets size to “md”. |
| `.grid-nogap` | axis gap | all | Sets gap to “none”. |
| `.grid-sm` | axis size | all | Sets size to “sm”. |
| `.grid-tight` | axis gap | all | Sets gap to “tight”. |
| `.grid-xl` | axis size | all | Sets size to “xl”. |
| `.grid-xs` | axis size | all | Sets size to “xs”. |
| `.grid-loading` | flag (loading) | all | Written by the loading prop. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### As many columns as fit

```html
<div>
  <div class="grid">
    <div class="grid-item">
      <div class="card">
        <div class="card-body">
          <h2 class="card-title">Groceries</h2>
          <p>Bread, eggs.</p>
        </div>
      </div>
    </div>
    <div class="grid-item grid-item-selected">
      <div class="card">
        <div class="card-body">
          <h2 class="card-title">Ideas</h2>
          <p>A grid that deals its items into lanes so the r…</p>
        </div>
      </div>
    </div>
    <div class="grid-item">  <!-- ×2 -->
      <div class="card">
        <div class="card-body">
          <h2 class="card-title">Call</h2>
          <p>The plumber, before Friday.</p>
        </div>
      </div>
    </div>
    <div class="grid-item grid-item-dirty">
      <div class="card">
        <div class="card-body">
          <h2 class="card-title">Garden</h2>
          <p>Water the dahlias. Stake the sunflowers.</p>
        </div>
      </div>
    </div>
    <div class="grid-item">  <!-- ×2 -->
      <div class="card">
        <div class="card-body">
          <h2 class="card-title">Trip</h2>
          <p>Train at 7:42, platform 3. Pack the charger, th…</p>
        </div>
      </div>
    </div>
  </div>
</div>
```

### Masonry

```html
<div>
  <div class="grid grid-masonry">
    <div class="grid-lane">
      <div class="grid-item">  <!-- ×7 -->
        <div class="card">
          <div class="card-body">
            <h2 class="card-title">Groceries</h2>
            <p>Bread, eggs.</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
```

### Gaps and sizes

```html
<div>
  <div class="grid grid-sm grid-tight">
    <div class="grid-item">  <!-- ×5 -->
      <div class="card">
        <div class="card-body">
          <h2 class="card-title">Groceries</h2>
          <p>Bread, eggs.</p>
        </div>
      </div>
    </div>
  </div>
</div>
```


---

# List

Rows of data in a painted box. Distinct from menu, which goes somewhere, and from tabs, which switches what is shown.

- Group: Data
- Namespaces: `list`
- Svelte: `<List>`
- Reference SCSS: [cosmos](reference/cosmos/list.scss), [dahlia](reference/dahlia/list.scss), [daisy](reference/daisy/list.scss), [peony](reference/peony/list.scss), [sunflower](reference/sunflower/list.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.list` | root | all | The component itself. |
| `.list-col-grow` | part | all | Inside a row: the column that takes the leftover width. |
| `.list-col-wrap` | part | all | Inside a row: the column allowed to wrap onto several lines. |
| `.list-empty` | part | all | Drawn in place of the rows when there are none. |
| `.list-row` | part | all | One row. The component wraps each of your snippets in one. |
| `.list-row-dirty` | part | all | A row whose key is in `dirty`: changed, not saved. |
| `.list-row-selected` | part | all | A row whose key is in `selected`. |
| `.list-lg` | axis size | all | Sets size to “lg”. |
| `.list-md` | axis size | all | Sets size to “md”. |
| `.list-sm` | axis size | all | Sets size to “sm”. |
| `.list-suggestions` | axis variant | all | A floating list of things to pick from, rather than a block of rows. |
| `.list-xl` | axis size | all | Sets size to “xl”. |
| `.list-xs` | axis size | all | Sets size to “xs”. |
| `.list-loading` | flag (loading) | all | Written by the loading prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.list-row`: `:hover` `[aria-selected=true]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Rows

```html
<ul class="list">
  <li class="list-row">  <!-- ×2 -->
    <div>
      <p>Item title</p>  <!-- ×2 -->
    </div>
    <div class="list-col-grow">Right</div>
  </li>
</ul>
```

### Plain rows

```html
<ul class="list">
  <li class="list-row">Deployment</li>  <!-- ×3 -->
</ul>
```

### One snippet for every row

```html
<ul class="list">
  <li class="list-row">  <!-- ×3 -->
    <div>
      <p>Deployment</p>  <!-- ×2 -->
    </div>
    <div class="list-col-grow">live</div>
  </li>
</ul>
```

### Suggestions

```html
<ul class="list list-suggestions" role="listbox">
  <li class="list-row" role="option" aria-selected="false">Paris</li>
  <li class="list-row" role="option" aria-selected="true">Lyon</li>
  <li class="list-row" role="option" aria-selected="false">Marseille</li>
</ul>
```

### Selected, changed, loading

```html
<ul class="list">
  <li class="list-row">
    <div>
      <p>Deployment</p>  <!-- ×2 -->
    </div>
    <div class="list-col-grow">live</div>
  </li>
  <li class="list-row list-row-selected">
    <div>
      <p>Build</p>  <!-- ×2 -->
    </div>
    <div class="list-col-grow">queued</div>
  </li>
  <li class="list-row list-row-dirty">
    <div>
      <p>Rollback</p>  <!-- ×2 -->
    </div>
    <div class="list-col-grow">failed</div>
  </li>
</ul>
```


---

# Kanban

Items in columns, one column per state they can be in. Like a table or a grid it knows nothing of where its items come from, and it moves nothing: dragging a card, or Shift + an arrow key on it, calls onmove, and the items change when you change them. Without onmove the board is read-only.

- Group: Data
- Namespaces: `kanban`
- Svelte: `<Kanban>`
- Reference SCSS: [cosmos](reference/cosmos/kanban.scss), [dahlia](reference/dahlia/kanban.scss), [daisy](reference/daisy/kanban.scss), [peony](reference/peony/kanban.scss), [sunflower](reference/sunflower/kanban.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.kanban` | root | all | The component itself. |
| `.kanban-column` | part | all | One column. |
| `.kanban-column-body` | part | all | The items of a column. Takes the height left, so the whole column can be dropped on. |
| `.kanban-column-count` | part | all | How many items a column holds. |
| `.kanban-column-empty` | part | all | Drawn in a column with no items. |
| `.kanban-column-foot` | part | all | Your `foot` snippet, under the items. |
| `.kanban-column-head` | part | all | A column’s heading: its title and count, or your `head` snippet. |
| `.kanban-column-over` | part | all | A column an item is being dragged over. |
| `.kanban-column-title` | part | all | The title of a column. |
| `.kanban-entry` | part | all | Where one item stands in the column: what comes, goes and moves, holding the item and, during a drag, the marker. |
| `.kanban-item` | part | all | One item. The component wraps each of yours in one. |
| `.kanban-item-dirty` | part | all | An item whose key is in `dirty`: changed, not saved. |
| `.kanban-item-dragged` | part | all | The item being dragged, where it came from. |
| `.kanban-item-selected` | part | all | An item whose key is in `selected`. |
| `.kanban-marker` | part | all | Where a dragged item would land: in the entry it would land before, or after the last one. Written by the component during a drag. |
| `.kanban-lg` | axis size | all | Sets size to “lg”. |
| `.kanban-loose` | axis gap | all | Sets gap to “loose”. |
| `.kanban-md` | axis size | all | Sets size to “md”. |
| `.kanban-nogap` | axis gap | all | Sets gap to “none”. |
| `.kanban-sm` | axis size | all | Sets size to “sm”. |
| `.kanban-tight` | axis gap | all | Sets gap to “tight”. |
| `.kanban-xl` | axis size | all | Sets size to “xl”. |
| `.kanban-xs` | axis size | all | Sets size to “xs”. |
| `.kanban-loading` | flag (loading) | all | Written by the loading prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.kanban-item`: `:focus-visible` `[draggable=true]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Kanban>`: `--motion-dx` `--motion-dy` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Kanban>`: `.kanban-entry` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<Kanban>`: `.kanban-entry` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<Kanban>`: `.kanban-entry` is marked `data-motion="move"` when the list reorders, `--motion-dx/dy` holding where it came from: the family plays it back from there.
- `<Kanban>`: An item that stands somewhere else after a change — another place in its list, or another list — is marked `data-motion="move"`, `--motion-dx/dy` holding where it stood: measured by the component (FLIP, motion.ts `Reflow`). An item that changed list neither leaves nor enters, it moves. The `animate` prop turns it off.
- `<Kanban>`: a `<Item>` moves between places with Svelte's `flip`, played in JavaScript by the component.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Move the items

```html
<div>
  <div class="kanban">
    <section class="kanban-column" aria-label="To do">
      <header class="kanban-column-head">
        <span class="kanban-column-title">To do</span>
        <span class="kanban-column-count">2</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="1" draggable="true" tabindex="0" aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+Arrow…">
            <div class="card card-sm">
              <div class="card-body">
                <span>Write the release notes</span>
                <div>
                  <span class="chip chip-xs">docs</span>
                </div>
              </div>
            </div>
          </div>
        </li>
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="2" draggable="true" tabindex="0" aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+Arrow…">
            <div class="card card-sm">
              <div class="card-body">
                <span>Plant the bulbs before the frost</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
    <section class="kanban-column" aria-label="In progress">
      <header class="kanban-column-head">
        <span class="kanban-column-title">In progress</span>
        <span class="kanban-column-count">2</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="3" draggable="true" tabindex="0" aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+Arrow…">
            <div class="card card-sm">
              <div class="card-body">
                <span>A table whose sticky columns measure themselves</span>
                <div>
                  <span class="chip chip-xs">table</span>
                </div>
              </div>
            </div>
          </div>
        </li>
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="4" draggable="true" tabindex="0" aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+Arrow…">
            <div class="card card-sm">
              <div class="card-body">
                <span>Fix the focus ring on dark themes</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
    <section class="kanban-column" aria-label="In review">
      <header class="kanban-column-head">
        <span class="kanban-column-title">In review</span>
        <span class="kanban-column-count">1</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="5" draggable="true" tabindex="0" aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+Arrow…">
            <div class="card card-sm">
              <div class="card-body">
                <span>Rename the drawer states</span>
                <div>
                  <span class="chip chip-xs">drawer</span>
                </div>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
    <section class="kanban-column" aria-label="Done">
      <header class="kanban-column-head">
        <span class="kanban-column-title">Done</span>
        <span class="kanban-column-count">1</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="6" draggable="true" tabindex="0" aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+Arrow…">
            <div class="card card-sm">
              <div class="card-body">
                <span>Ship the carousel</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
  </div>
</div>
```

### Read-only

```html
<div>
  <div class="kanban kanban-sm kanban-tight">
    <section class="kanban-column" aria-label="To do">
      <header class="kanban-column-head">
        <span class="kanban-column-title">To do</span>
        <span class="kanban-column-count">2</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item kanban-item-dirty" data-kanban-key="1">
            <div class="card card-sm">
              <div class="card-body">
                <span>Write the release notes</span>
                <div>
                  <span class="chip chip-xs">docs</span>
                </div>
              </div>
            </div>
          </div>
        </li>
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="2">
            <div class="card card-sm">
              <div class="card-body">
                <span>Plant the bulbs before the frost</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
    <section class="kanban-column" aria-label="In progress">
      <header class="kanban-column-head">
        <span class="kanban-column-title">In progress</span>
        <span class="kanban-column-count">2</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item kanban-item-selected" data-kanban-key="3">
            <div class="card card-sm">
              <div class="card-body">
                <span>A table whose sticky columns measure themselves</span>
                <div>
                  <span class="chip chip-xs">table</span>
                </div>
              </div>
            </div>
          </div>
        </li>
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="4">
            <div class="card card-sm">
              <div class="card-body">
                <span>Fix the focus ring on dark themes</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
    <section class="kanban-column" aria-label="In review">
      <header class="kanban-column-head">
        <span class="kanban-column-title">In review</span>
        <span class="kanban-column-count">1</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="5">
            <div class="card card-sm">
              <div class="card-body">
                <span>Rename the drawer states</span>
                <div>
                  <span class="chip chip-xs">drawer</span>
                </div>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
    <section class="kanban-column" aria-label="Done">
      <header class="kanban-column-head">
        <span class="kanban-column-title">Done</span>
        <span class="kanban-column-count">1</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="6">
            <div class="card card-sm">
              <div class="card-body">
                <span>Ship the carousel</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </section>
  </div>
</div>
```

### Your own head and foot

```html
<div>
  <div class="kanban">
    <section class="kanban-column" aria-label="To do">
      <header class="kanban-column-head">
        <strong>To do</strong>
        <span class="chip chip-xs">2 / 3</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="1">
            <div class="card card-sm">
              <div class="card-body">
                <span>Write the release notes</span>
                <div>
                  <span class="chip chip-xs">docs</span>
                </div>
              </div>
            </div>
          </div>
        </li>
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="2">
            <div class="card card-sm">
              <div class="card-body">
                <span>Plant the bulbs before the frost</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
      <footer class="kanban-column-foot">
        <button class="btn btn-sm">Add</button>
      </footer>
    </section>
    <section class="kanban-column" aria-label="In progress">
      <header class="kanban-column-head">
        <strong>In progress</strong>
        <span class="chip chip-xs">2 / 3</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="3">
            <div class="card card-sm">
              <div class="card-body">
                <span>A table whose sticky columns measure themselves</span>
                <div>
                  <span class="chip chip-xs">table</span>
                </div>
              </div>
            </div>
          </div>
        </li>
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="4">
            <div class="card card-sm">
              <div class="card-body">
                <span>Fix the focus ring on dark themes</span>
              </div>
            </div>
          </div>
        </li>
      </ul>
      <footer class="kanban-column-foot">
        <button class="btn btn-sm">Add</button>
      </footer>
    </section>
    <section class="kanban-column" aria-label="In review">
      <header class="kanban-column-head">
        <strong>In review</strong>
        <span class="chip chip-xs">1 / 3</span>
      </header>
      <ul class="kanban-column-body">
        <li class="kanban-entry">
          <div class="kanban-item" data-kanban-key="5">
            <div class="card card-sm">
              <div class="card-body">
                <span>Rename the drawer states</span>
                <div>
                  <span class="chip chip-xs">drawer</span>
                </div>
              </div>
            </div>
          </div>
        </li>
      </ul>
      <footer class="kanban-column-foot">
        <button class="btn btn-sm">Add</button>
      </footer>
    </section>
    <section class="kanban-column" aria-label="Done">
      <header class="kanban-column-head">
        <strong>Done</strong>
        <span class="chip chip-xs">0 / 3</span>
      </header>
      <div class="kanban-column-empty">Nothing here.</div>
      <ul class="kanban-column-body"></ul>
      <footer class="kanban-column-foot">
        <button class="btn btn-sm">Add</button>
      </footer>
    </section>
  </div>
</div>
```

### Around a data handler

```html
<div>
  <div class="data-control">
    <div class="data-control-bar">
      <div class="data-control-bar-left">
        <div class="dropdown dropdown-fixed">
          <button aria-expanded="false" aria-controls="s2-content" aria-haspopup="true" title="Filters" aria-label="Filters" class="btn btn-ghost">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
            Filters
          </button>
        </div>
        <div class="dropdown dropdown-fixed">
          <button aria-expanded="false" aria-controls="s3-content" aria-haspopup="true" title="Name, A–Z" aria-label="Sort" class="btn btn-ghost">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
            Name, A–Z
          </button>
        </div>
        <label class="input data-control-search">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
          <input type="search" placeholder="Search" aria-label="Search" value="">
        </label>
      </div>
      <div class="data-control-bar-right">
        <select aria-label="12 per page" class="select">
          <option disabled="" hidden=""></option>
          <option value="12" selected="">12 per page</option>
          <option value="24">24 per page</option>
        </select>
        <button title="Undo" aria-label="Undo" class="btn btn-square btn-ghost" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button title="Redo" aria-label="Redo" class="btn btn-square btn-ghost" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button title="Discard changes" aria-label="Discard changes" class="btn btn-square btn-ghost" disabled="">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
        </button>
        <button title="Save" aria-label="Save" class="btn btn-primary" disabled="">Save</button>
      </div>
    </div>
    <div class="data-control-body">
      <div class="kanban">
        <section class="kanban-column" aria-label="Admins">
          <header class="kanban-column-head">
            <span class="kanban-column-title">Admins</span>
            <span class="kanban-column-count">0</span>
          </header>
          <ul class="kanban-column-body"></ul>
        </section>
        <section class="kanban-column" aria-label="Editors">
          <header class="kanban-column-head">
            <span class="kanban-column-title">Editors</span>
            <span class="kanban-column-count">0</span>
          </header>
          <ul class="kanban-column-body"></ul>
        </section>
        <section class="kanban-column" aria-label="Viewers">
          <header class="kanban-column-head">
            <span class="kanban-column-title">Viewers</span>
            <span class="kanban-column-count">0</span>
          </header>
          <ul class="kanban-column-body"></ul>
        </section>
      </div>
    </div>
    <dialog class="dialog dialog-sm"></dialog>
  </div>
</div>
```


---

# File explorer

Files and folders in a hierarchy, Drive-like: the folder tree, the current folder as a list or a grid, the details of the selection, under a toolbar with the path and your actions. Folders load lazily. Drag and drop — inside, or files from the system — is reported, never performed: the app moves, then refreshes.

- Group: Data
- Namespaces: `file-explorer`
- Svelte: `<FileExplorer>`
- Reference SCSS: [cosmos](reference/cosmos/file-explorer.scss), [dahlia](reference/dahlia/file-explorer.scss), [daisy](reference/daisy/file-explorer.scss), [peony](reference/peony/file-explorer.scss), [sunflower](reference/sunflower/file-explorer.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.file-explorer` | root | all | The frame; its height is --file-explorer-height. |
| `.file-explorer-actions` | part | all | Your toolbar snippet. |
| `.file-explorer-content` | part | all | The current folder; focusable, walked with the arrows. |
| `.file-explorer-details` | part | all | The details pane, while something is selected. |
| `.file-explorer-empty` | part | all | A piece the component draws; never opted into. |
| `.file-explorer-entry` | part | all | A piece the component draws; never opted into. |
| `.file-explorer-grid` | part | all | The grid view. |
| `.file-explorer-icon` | part | all | A node icon; data-kind="folder" takes the folder colour. |
| `.file-explorer-item` | part | all | One file or folder; aria-selected, data-drop while a valid drop hovers it. |
| `.file-explorer-main` | part | all | A piece the component draws; never opted into. |
| `.file-explorer-menu` | part | all | The context menu. |
| `.file-explorer-meta` | part | all | A piece the component draws; never opted into. |
| `.file-explorer-name` | part | all | A piece the component draws; never opted into. |
| `.file-explorer-path` | part | all | The path, a .breadcrumbs. |
| `.file-explorer-table` | part | all | The list view, sortable by name, date and size. |
| `.file-explorer-thumb` | part | all | A piece the component draws; never opted into. |
| `.file-explorer-toolbar` | part | all | Path, actions and the view toggle. |
| `.file-explorer-tree` | part | all | The folder tree. |
| `.file-explorer-tree-item` | part | all | One folder in the tree; aria-current on the shown one. |
| `.file-explorer-twisty` | part | all | The chevron that expands a branch. |
| `.file-explorer-view` | part | all | A piece the component draws; never opted into. |
| `.file-explorer-views` | part | all | The list / grid toggle. |
| `.file-explorer-lg` | axis size | all | Sets size to “lg”. |
| `.file-explorer-md` | axis size | all | Sets size to “md”. |
| `.file-explorer-sm` | axis size | all | Sets size to “sm”. |
| `.file-explorer-xl` | axis size | all | Sets size to “xl”. |
| `.file-explorer-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.file-explorer-content`: `:focus-visible` `[data-drop]`
- `.file-explorer-icon`: `[data-kind=folder]` `[data-preview]`
- `.file-explorer-item`: `:hover` `[aria-selected=true]` `[data-drop]` `[data-focus]`
- `.file-explorer-tree-item`: `:hover` `[aria-current=true]` `[data-drop]`
- `.file-explorer-twisty`: `:empty` `[data-leaf]`
- `.file-explorer-view`: `[aria-pressed=true]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<FileExplorer>`: `--file-explorer-bg` `--file-explorer-icon-color` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<FileExplorer>`: a `<ul>` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<FileExplorer>`: a `<ul>` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<FileExplorer>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Drive

```html
<div>
  <div class="file-explorer">
    <div class="file-explorer-toolbar">
      <nav aria-label="Path" class="breadcrumbs file-explorer-path">
        <ul>
          <li>
            <button type="button">Files</button>
          </li>
        </ul>
      </nav>
      <div class="file-explorer-actions">
        <button class="btn btn-sm">New folder</button>
      </div>
      <div class="file-explorer-views" role="group">
        <button type="button" class="file-explorer-view" aria-pressed="true" aria-label="List view" title="List view">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">…</svg>
        </button>
        <button type="button" class="file-explorer-view" aria-pressed="false" aria-label="Grid view" title="Grid view">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round">…</svg>
        </button>
      </div>
    </div>
    <div class="file-explorer-main">
      <nav class="file-explorer-tree" aria-label="Folders">
        <ul role="tree" aria-label="Folders">
          <li role="treeitem" aria-expanded="true" aria-selected="true">
            <button type="button" class="file-explorer-tree-item" aria-current="true">
              <span class="file-explorer-twisty" data-leaf=""></span>
              <span class="file-explorer-icon" data-kind="folder" aria-hidden="true">
                <svg viewBox="0 0 24 24" fill="currentColor">…</svg>
              </span>
              <span>Files</span>
            </button>
            <ul role="group"></ul>
          </li>
        </ul>
      </nav>
      <div class="file-explorer-content" role="listbox" aria-multiselectable="true" aria-label="Files" tabindex="0">
        <div class="file-explorer-empty">This folder is empty</div>
      </div>
    </div>
  </div>
  <small>—</small>
</div>
```

### Grid, static tree, no tree pane

```html
<div>
  <div style="--file-explorer-height: 18em" class="file-explorer">
    <div class="file-explorer-toolbar">
      <nav aria-label="Path" class="breadcrumbs file-explorer-path">
        <ul>
          <li>
            <button type="button">Holiday</button>
          </li>
        </ul>
      </nav>
      <div class="file-explorer-views" role="group">
        <button type="button" class="file-explorer-view" aria-pressed="false" aria-label="List view" title="List view">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">…</svg>
        </button>
        <button type="button" class="file-explorer-view" aria-pressed="true" aria-label="Grid view" title="Grid view">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round">…</svg>
        </button>
      </div>
    </div>
    <div class="file-explorer-main">
      <div class="file-explorer-content" role="listbox" aria-multiselectable="true" aria-label="Holiday" tabindex="0">
        <div class="file-explorer-empty">This folder is empty</div>
      </div>
    </div>
  </div>
</div>
```

### Icons by extension

```html
<div class="file-explorer">
  <div class="file-explorer-toolbar">
    <nav aria-label="Path" class="breadcrumbs file-explorer-path">
      <ul>
        <li>
          <button type="button">Files</button>
        </li>
      </ul>
    </nav>
    <div class="file-explorer-views" role="group">
      <button type="button" class="file-explorer-view" aria-pressed="false" aria-label="List view" title="List view">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">…</svg>
      </button>
      <button type="button" class="file-explorer-view" aria-pressed="true" aria-label="Grid view" title="Grid view">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round">…</svg>
      </button>
    </div>
  </div>
  <div class="file-explorer-main">
    <div class="file-explorer-content" role="listbox" aria-multiselectable="true" aria-label="Files" tabindex="0">
      <div class="file-explorer-empty">This folder is empty</div>
    </div>
  </div>
</div>
```


---

# Menu

Navigation with one current item, optional section titles and optional nested groups. It owns its frame, unlike navbar and dock, which are placement only.

- Group: Navigation
- Namespaces: `menu`
- Svelte: `<Menu>`
- Reference SCSS: [cosmos](reference/cosmos/menu.scss), [dahlia](reference/dahlia/menu.scss), [daisy](reference/daisy/menu.scss), [peony](reference/peony/menu.scss), [sunflower](reference/sunflower/menu.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.menu` | root | all | The component itself. |
| `.menu-active` | part | all | Where the visitor currently is. |
| `.menu-disabled` | part | all | Unreachable, and drawn as such. |
| `.menu-item` | part | all | One row. The component draws it as an <a> when the node has an href, a <button> otherwise. |
| `.menu-sub` | part | all | The nested group itself. |
| `.menu-sub-closed` | part | all | Collapsed. The animation is in the CSS; the component only swaps the class. |
| `.menu-title` | part | all | A section heading between two groups. An empty <li> is a divider. |
| `.menu-toggle` | part | all | A row that carries a nested group, and therefore opens it. |
| `.menu-horizontal` | axis direction | all | Sets direction to “horizontal”. |
| `.menu-lg` | axis size | all | Sets size to “lg”. |
| `.menu-md` | axis size | all | Sets size to “md”. |
| `.menu-sm` | axis size | all | Sets size to “sm”. |
| `.menu-xl` | axis size | all | Sets size to “xl”. |
| `.menu-xs` | axis size | all | Sets size to “xs”. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Menu>`: `--menu-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Menu

```html
<ul class="menu">
  <li class="menu-title">Form</li>
  <li>
    <a class="menu-item" href="#demo">Button</a>
  </li>
  <li>
    <a class="menu-item menu-active" href="#demo" aria-current="page">Input</a>
  </li>
  <li>
    <a class="menu-item menu-disabled" aria-disabled="true">Select</a>
  </li>
  <li></li>
  <li class="menu-title">Display</li>
  <li>
    <button type="button" class="menu-item menu-toggle" aria-expanded="true" aria-controls="s1-6">Feedback</button>
    <ul id="s1-6" class="menu-sub">
      <li>  <!-- ×2 -->
        <a class="menu-item" href="#demo">Progress</a>
      </li>
    </ul>
  </li>
</ul>
```

### A group that opens

```html
<ul class="menu">
  <li>
    <button type="button" class="menu-item menu-toggle" aria-expanded="false" aria-controls="s2-0">Navigation</button>
    <ul id="s2-0" class="menu-sub menu-sub-closed" inert="">
      <li>  <!-- ×2 -->
        <a class="menu-item" href="#demo">Breadcrumbs</a>
      </li>
    </ul>
  </li>
</ul>
```

### Horizontal

```html
<ul class="menu menu-horizontal">
  <li>
    <a class="menu-item menu-active" href="#demo" aria-current="page">Overview</a>
  </li>
  <li>  <!-- ×2 -->
    <a class="menu-item" href="#demo">Settings</a>
  </li>
</ul>
```

### Sizes

```html
<div>
  <ul class="menu menu-xs">
    <li>
      <a class="menu-item menu-active" href="#demo" aria-current="page">xs</a>
    </li>
    <li>
      <a class="menu-item" href="#demo">item</a>
    </li>
  </ul>
  <ul class="menu menu-sm">
    <li>
      <a class="menu-item menu-active" href="#demo" aria-current="page">sm</a>
    </li>
    <li>
      <a class="menu-item" href="#demo">item</a>
    </li>
  </ul>
  <ul class="menu menu-md">
    <li>
      <a class="menu-item menu-active" href="#demo" aria-current="page">md</a>
    </li>
    <li>
      <a class="menu-item" href="#demo">item</a>
    </li>
  </ul>
  <ul class="menu menu-lg">
    <li>
      <a class="menu-item menu-active" href="#demo" aria-current="page">lg</a>
    </li>
    <li>
      <a class="menu-item" href="#demo">item</a>
    </li>
  </ul>
  <ul class="menu menu-xl">
    <li>
      <a class="menu-item menu-active" href="#demo" aria-current="page">xl</a>
    </li>
    <li>
      <a class="menu-item" href="#demo">item</a>
    </li>
  </ul>
</div>
```

### A snippet for every row

```html
<ul class="menu">
  <li>
    <a class="menu-item menu-active" href="#demo" aria-current="page">
      <span>#</span>  <!-- ×2 -->
      <div class="badge">3</div>
    </a>
  </li>
  <li>  <!-- ×2 -->
    <a class="menu-item" href="#demo">
      <span>#</span>  <!-- ×2 -->
      <div class="badge">3</div>
    </a>
  </li>
</ul>
```

### One row that differs

```html
<ul class="menu">
  <li>
    <a class="menu-item" href="#demo">Inbox</a>
  </li>
  <li>
    <a class="menu-item" href="#demo">
      <span>Unread</span>
      <div color="error" class="badge">12</div>
    </a>
  </li>
  <li>
    <a class="menu-item" href="#demo">Archive</a>
  </li>
</ul>
```


---

# Tabs

Switching which panel is visible. One namespace covers the strip and the tabs in it (ADR 0009): the strip is .tabs, a tab is .tabs-item.

- Group: Navigation
- Namespaces: `tabs`
- Svelte: `<Tabs>`
- Reference SCSS: [cosmos](reference/cosmos/tabs.scss), [dahlia](reference/dahlia/tabs.scss), [daisy](reference/daisy/tabs.scss), [peony](reference/peony/tabs.scss), [sunflower](reference/sunflower/tabs.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.tabs` | root | all | The component itself. |
| `.tabs-indicator` | part | all | A piece the component draws; never opted into. |
| `.tabs-item` | part | all | One tab in the strip. The component draws it from the tabs data. |
| `.tabs-item-active` | part | all | The selected tab. Written from the active index, alongside aria-selected. |
| `.tabs-item-content` | part | all | The panel a tab reveals. It must follow its tab immediately — the CSS reaches it with +. |
| `.tabs-item-disabled` | part | all | Unreachable, and drawn as such. |
| `.tabs-border` | axis variant | all | Sets variant to “border”. |
| `.tabs-bottom` | axis placement | all | Sets placement to “bottom”. |
| `.tabs-box` | axis variant | all | Sets variant to “box”. |
| `.tabs-lg` | axis size | all | Sets size to “lg”. |
| `.tabs-lift` | axis variant | all | Sets variant to “lift”. |
| `.tabs-md` | axis size | all | Sets size to “md”. |
| `.tabs-sm` | axis size | all | Sets size to “sm”. |
| `.tabs-top` | axis placement | all | Sets placement to “top”. |
| `.tabs-xl` | axis size | all | Sets size to “xl”. |
| `.tabs-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.tabs-item`: `:checked` `:disabled` `:empty` `:focus` `:focus-visible` `:hover` `[aria-current=page]` `[aria-current=true]` `[aria-selected=true]` `[disabled]` `[type=radio]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Tabs>`: `--tabs-h` `--tabs-w` `--tabs-x` `--tabs-y`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Border

```html
<div role="tablist" class="tabs tabs-border">
  <span class="tabs-item tabs-item-active tabs-indicator" aria-hidden="true"></span>
  <button type="button" role="tab" class="tabs-item tabs-item-active" aria-selected="true">Tab 1</button>
  <button type="button" role="tab" class="tabs-item" aria-selected="false">Tab 2</button>  <!-- ×2 -->
</div>
```

### Box

```html
<div role="tablist" class="tabs tabs-box">
  <span class="tabs-item tabs-item-active tabs-indicator" aria-hidden="true"></span>
  <button type="button" role="tab" class="tabs-item tabs-item-active" aria-selected="true">Tab 1</button>
  <button type="button" role="tab" class="tabs-item" aria-selected="false">Tab 2</button>  <!-- ×2 -->
</div>
```

### With panels

```html
<div role="tablist" class="tabs tabs-lift">
  <span class="tabs-item tabs-item-active tabs-indicator" aria-hidden="true"></span>
  <button type="button" role="tab" class="tabs-item tabs-item-active" aria-selected="true">Tab 1</button>
  <div class="tabs-item-content">
    <p>The first panel.</p>
  </div>
  <button type="button" role="tab" class="tabs-item" aria-selected="false">Tab 2</button>
  <div class="tabs-item-content">
    <p>The second panel.</p>
  </div>
  <button type="button" role="tab" class="tabs-item tabs-item-disabled" aria-selected="false" disabled="">Tab 3</button>
  <div class="tabs-item-content">
    <p>The third panel.</p>
  </div>
</div>
```

### A tab that is not just text

```html
<div role="tablist" class="tabs tabs-box">
  <span class="tabs-item tabs-item-active tabs-indicator" aria-hidden="true"></span>
  <button type="button" role="tab" class="tabs-item tabs-item-active" aria-selected="true">Overview</button>
  <button type="button" role="tab" class="tabs-item" aria-selected="false">
    <span>
      Issues
      <div class="badge">7</div>
    </span>
  </button>
  <button type="button" role="tab" class="tabs-item" aria-selected="false">Settings</button>
</div>
```


---

# Breadcrumbs

Where you are in a hierarchy, and the way back up. Text-natured: it draws no frame, so --scale leaves it alone.

- Group: Navigation
- Namespaces: `breadcrumbs`
- Svelte: `<Breadcrumbs>`
- Reference SCSS: [cosmos](reference/cosmos/breadcrumbs.scss), [dahlia](reference/dahlia/breadcrumbs.scss), [daisy](reference/daisy/breadcrumbs.scss), [peony](reference/peony/breadcrumbs.scss), [sunflower](reference/sunflower/breadcrumbs.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.breadcrumbs` | root | all | The component itself. |
| `.breadcrumbs-lg` | axis size | all | Sets size to “lg”. |
| `.breadcrumbs-md` | axis size | all | Sets size to “md”. |
| `.breadcrumbs-sm` | axis size | all | Sets size to “sm”. |
| `.breadcrumbs-xl` | axis size | all | Sets size to “xl”. |
| `.breadcrumbs-xs` | axis size | all | Sets size to “xs”. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Breadcrumbs

```html
<nav class="breadcrumbs">
  <ul>
    <li>  <!-- ×2 -->
      <a href="#demo">Home</a>
    </li>
    <li>Add Document</li>
  </ul>
</nav>
```


---

# Steps

Where the user is in a journey: one column per step, one bar per sub-step. Four states — current, visited, complete (declared by the app), unknown — and errors or warnings once a step is reached. It moves nothing: clicks go to onstep.

- Group: Navigation
- Namespaces: `steps`
- Svelte: `<Steps>`
- Reference SCSS: [cosmos](reference/cosmos/steps.scss), [dahlia](reference/dahlia/steps.scss), [daisy](reference/daisy/steps.scss), [peony](reference/peony/steps.scss), [sunflower](reference/sunflower/steps.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.steps` | root | all | The journey. Horizontal unless vertical. |
| `.steps-heading` | part | all | The line above the bars in compact mode. |
| `.steps-issue` | part | all | The warning or error icon. |
| `.steps-item` | part | all | One step; its data-state is current, visited, complete or unknown. |
| `.steps-label` | part | all | The step's label, and its issue icon. |
| `.steps-list` | part | all | The steps, in order. |
| `.steps-marker` | part | all | The disc at the start of a step; a check once complete. |
| `.steps-segment` | part | all | One bar per sub-step; data-state and data-issue paint it. |
| `.steps-sublabel` | part | all | The current sub-step, under the current step. |
| `.steps-track` | part | all | The marker and the bars of a step. |
| `.steps-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.steps-error` | axis color | all | Sets color to “error”. |
| `.steps-horizontal` | axis direction | all | Sets direction to “horizontal”. |
| `.steps-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.steps-lg` | axis size | all | Sets size to “lg”. |
| `.steps-md` | axis size | all | Sets size to “md”. |
| `.steps-neutral` | axis color | all | Sets color to “neutral”. |
| `.steps-primary` | axis color | all | Sets color to “primary”. |
| `.steps-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.steps-sm` | axis size | all | Sets size to “sm”. |
| `.steps-success` | axis color | all | Sets color to “success”. |
| `.steps-vertical` | axis direction | all | Sets direction to “vertical”. |
| `.steps-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.steps-xl` | axis size | all | Sets size to “xl”. |
| `.steps-xs` | axis size | all | Sets size to “xs”. |
| `.steps-compact` | flag (compact) | all | Written by the compact prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.steps-issue`: `[data-issue=warning]`
- `.steps-item`: `[data-state=complete]` `[data-state=current]` `[data-state=unknown]` `[data-state=visited]`
- `.steps-marker`: `:disabled` `:focus-visible`
- `.steps-segment`: `:disabled` `:focus-visible` `:hover` `[data-issue=error]` `[data-issue=warning]` `[data-state=complete]` `[data-state=current]` `[data-state=visited]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### With sub-steps

```html
<div>
  <nav class="steps" aria-label="Progress">
    <ol class="steps-list">
      <li class="steps-item" data-state="complete">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Basics">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="complete" title="Photos" aria-label="Photos">
            <span></span>
          </button>
          <button type="button" class="steps-segment" data-state="complete" title="Title" aria-label="Title">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Basics</span>
        </p>
      </li>
      <li class="steps-item" data-state="current">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Price">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="visited" data-issue="warning" title="Check the currency" aria-label="Amount">
            <span></span>
          </button>
          <button type="button" class="steps-segment" data-state="current" title="Discounts" aria-label="Discounts" aria-current="step">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Price</span>
          <span class="steps-issue" data-issue="warning" title="Check the currency" role="img" aria-label="Check the currency">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </span>
        </p>
        <p class="steps-sublabel">Discounts</p>
      </li>
      <li class="steps-item" data-state="unknown">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Delivery" disabled="">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="unknown" title="Delivery" aria-label="Delivery" disabled="">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Delivery</span>
        </p>
      </li>
      <li class="steps-item" data-state="unknown">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Publish" disabled="">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="unknown" title="Publish" aria-label="Publish" disabled="">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Publish</span>
        </p>
      </li>
    </ol>
  </nav>
</div>
```

### Compact

```html
<div>
  <nav class="steps steps-compact" aria-label="Progress">
    <div class="steps-heading">
      <span>
        Price
        · Discounts
      </span>
      <span>2/4</span>
    </div>
    <ol class="steps-list">
      <li class="steps-item" data-state="complete">
        <div class="steps-track">
          <button type="button" class="steps-segment" data-state="complete" title="Photos" aria-label="Photos">
            <span></span>
          </button>
          <button type="button" class="steps-segment" data-state="complete" title="Title" aria-label="Title">
            <span></span>
          </button>
        </div>
      </li>
      <li class="steps-item" data-state="current">
        <div class="steps-track">
          <button type="button" class="steps-segment" data-state="visited" data-issue="warning" title="Check the currency" aria-label="Amount">
            <span></span>
          </button>
          <button type="button" class="steps-segment" data-state="current" title="Discounts" aria-label="Discounts" aria-current="step">
            <span></span>
          </button>
        </div>
      </li>
      <li class="steps-item" data-state="unknown">
        <div class="steps-track">
          <button type="button" class="steps-segment" data-state="unknown" title="Delivery" aria-label="Delivery" disabled="">
            <span></span>
          </button>
        </div>
      </li>
      <li class="steps-item" data-state="unknown">
        <div class="steps-track">
          <button type="button" class="steps-segment" data-state="unknown" title="Publish" aria-label="Publish" disabled="">
            <span></span>
          </button>
        </div>
      </li>
    </ol>
  </nav>
</div>
```

### Vertical

```html
<div>
  <nav class="steps steps-vertical steps-success" aria-label="Progress">
    <ol class="steps-list">
      <li class="steps-item" data-state="complete">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Basics">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="complete" title="Photos" aria-label="Photos">
            <span></span>
          </button>
          <button type="button" class="steps-segment" data-state="complete" title="Title" aria-label="Title">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Basics</span>
        </p>
      </li>
      <li class="steps-item" data-state="current">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Price">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="visited" data-issue="warning" title="Check the currency" aria-label="Amount">
            <span></span>
          </button>
          <button type="button" class="steps-segment" data-state="current" title="Discounts" aria-label="Discounts" aria-current="step">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Price</span>
          <span class="steps-issue" data-issue="warning" title="Check the currency" role="img" aria-label="Check the currency">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </span>
        </p>
        <p class="steps-sublabel">Discounts</p>
      </li>
      <li class="steps-item" data-state="unknown">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Delivery" disabled="">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="unknown" title="Delivery" aria-label="Delivery" disabled="">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Delivery</span>
        </p>
      </li>
      <li class="steps-item" data-state="unknown">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="Publish" disabled="">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="unknown" title="Publish" aria-label="Publish" disabled="">
            <span></span>
          </button>
        </div>
        <p class="steps-label">
          <span>Publish</span>
        </p>
      </li>
    </ol>
  </nav>
</div>
```

### Without labels, not clickable

```html
<div>
  <nav class="steps" aria-label="Progress">
    <ol class="steps-list">
      <li class="steps-item" data-state="complete">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="1" disabled="">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="complete" aria-label="1" disabled="">
            <span></span>
          </button>
        </div>
      </li>
      <li class="steps-item" data-state="current">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="2" disabled="">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="current" aria-label="2" aria-current="step" disabled="">
            <span></span>
          </button>
        </div>
      </li>
      <li class="steps-item" data-state="unknown">
        <div class="steps-track">
          <button type="button" class="steps-marker" aria-label="3" disabled="">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">…</svg>
          </button>
          <button type="button" class="steps-segment" data-state="unknown" aria-label="3" disabled="">
            <span></span>
          </button>
        </div>
      </li>
    </ol>
  </nav>
</div>
```


---

# Pagination

A row of pages to jump between, with previous / next. The current page is marked by `aria-current="page"`, not by a class. With `edges`, the first and last pages stay and far ones fold into a gap. Three variants draw the same pages differently: dots, bars, count.

- Group: Navigation
- Namespaces: `pagination`
- Svelte: `<Pagination>`
- Reference SCSS: [cosmos](reference/cosmos/pagination.scss), [dahlia](reference/dahlia/pagination.scss), [daisy](reference/daisy/pagination.scss), [peony](reference/peony/pagination.scss), [sunflower](reference/sunflower/pagination.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.pagination` | root | all | The component itself. |
| `.pagination-gap` | part | all | The “…” standing for pages that are not drawn. |
| `.pagination-item` | part | all | One page, or a previous / next control. |
| `.pagination-number` | part | peony | The number inside a page; a new one on every change, so a family can animate it. The row carries `data-direction="next \| previous"` after a move. |
| `.pagination-text` | part | all | The “3 / 8” of the count variant. |
| `.pagination-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.pagination-bars` | axis variant | all | A segment per page, stretched across the row. |
| `.pagination-count` | axis variant | all | No page drawn: “3 / 8” between previous and next. |
| `.pagination-dots` | axis variant | all | A dot per page instead of its number — as under a carousel. |
| `.pagination-error` | axis color | all | Sets color to “error”. |
| `.pagination-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.pagination-lg` | axis size | all | Sets size to “lg”. |
| `.pagination-md` | axis size | all | Sets size to “md”. |
| `.pagination-neutral` | axis color | all | Sets color to “neutral”. |
| `.pagination-primary` | axis color | all | Sets color to “primary”. |
| `.pagination-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.pagination-sm` | axis size | all | Sets size to “sm”. |
| `.pagination-success` | axis color | all | Sets color to “success”. |
| `.pagination-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.pagination-xl` | axis size | all | Sets size to “xl”. |
| `.pagination-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.pagination`: `[data-direction=next]` `[data-direction=previous]`
- `.pagination-item`: `:active` `:disabled` `:focus-visible` `:hover` `[aria-current=page]`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Edges

```html
<div>
  <nav class="pagination">
    <button type="button" class="pagination-item" aria-label="Previous page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 1">
      <span class="pagination-number">1</span>
    </button>
    <span class="pagination-gap" aria-hidden="true">…</span>
    <button type="button" class="pagination-item" aria-label="Page 5">
      <span class="pagination-number">5</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 6" aria-current="page">
      <span class="pagination-number">6</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 7">
      <span class="pagination-number">7</span>
    </button>
    <span class="pagination-gap" aria-hidden="true">…</span>
    <button type="button" class="pagination-item" aria-label="Page 12">
      <span class="pagination-number">12</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Next page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
  </nav>
  <small>page: 6</small>
</div>
```

### Default: a window

```html
<div>
  <nav class="pagination">
    <button type="button" class="pagination-item" aria-label="Previous page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 6" aria-current="page">
      <span class="pagination-number">6</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Next page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
  </nav>
  <nav class="pagination">
    <button type="button" class="pagination-item" aria-label="Previous page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 5">
      <span class="pagination-number">5</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 6" aria-current="page">
      <span class="pagination-number">6</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 7">
      <span class="pagination-number">7</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Next page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
  </nav>
</div>
```

### Colors and sizes

```html
<div>
  <nav class="pagination pagination-neutral pagination-sm">
    <button type="button" class="pagination-item" aria-label="Previous page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 1">
      <span class="pagination-number">1</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 2" aria-current="page">
      <span class="pagination-number">2</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 3">
      <span class="pagination-number">3</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Next page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
  </nav>
  <nav class="pagination pagination-success pagination-lg">
    <button type="button" class="pagination-item" aria-label="Previous page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 2">
      <span class="pagination-number">2</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 3" aria-current="page">
      <span class="pagination-number">3</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 4">
      <span class="pagination-number">4</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Next page">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
    </button>
  </nav>
</div>
```

### Dots

```html
<nav class="pagination pagination-dots">
  <button type="button" class="pagination-item" aria-label="Page 1">
    <span class="pagination-number">1</span>
  </button>
  <button type="button" class="pagination-item" aria-label="Page 2" aria-current="page">
    <span class="pagination-number">2</span>
  </button>
  <button type="button" class="pagination-item" aria-label="Page 3">
    <span class="pagination-number">3</span>
  </button>
  <button type="button" class="pagination-item" aria-label="Page 4">
    <span class="pagination-number">4</span>
  </button>
  <button type="button" class="pagination-item" aria-label="Page 5">
    <span class="pagination-number">5</span>
  </button>
</nav>
```

### Bars

```html
<div>
  <nav class="pagination pagination-bars">
    <button type="button" class="pagination-item" aria-label="Page 1">
      <span class="pagination-number">1</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 2" aria-current="page">
      <span class="pagination-number">2</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 3">
      <span class="pagination-number">3</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 4">
      <span class="pagination-number">4</span>
    </button>
    <button type="button" class="pagination-item" aria-label="Page 5">
      <span class="pagination-number">5</span>
    </button>
  </nav>
</div>
```

### Count

```html
<nav class="pagination pagination-count">
  <button type="button" class="pagination-item" aria-label="Previous page">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
  </button>
  <span class="pagination-text" aria-live="polite">3 / 12</span>
  <button type="button" class="pagination-item" aria-label="Next page">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">…</svg>
  </button>
</nav>
```


---

# Dock

A bar pinned to the bottom edge, for the two to five places you go most. Its height answers to the screen rather than to its content — one of the few absolute values in the kit.

- Group: Navigation
- Namespaces: `dock`
- Svelte: `<Dock>`
- Reference SCSS: [cosmos](reference/cosmos/dock.scss), [dahlia](reference/dahlia/dock.scss), [daisy](reference/daisy/dock.scss), [peony](reference/peony/dock.scss), [sunflower](reference/sunflower/dock.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.dock` | root | all | The component itself. |
| `.dock-active` | part | all | The destination you are on. |
| `.dock-label` | part | all | The text under a dock icon. |
| `.dock-lg` | axis size | all | Sets size to “lg”. |
| `.dock-md` | axis size | all | Sets size to “md”. |
| `.dock-sm` | axis size | all | Sets size to “sm”. |
| `.dock-xl` | axis size | all | Sets size to “xl”. |
| `.dock-xs` | axis size | all | Sets size to “xs”. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Dock

```html
<div>
  <nav class="dock">
    <button>
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">…</svg>
      <span class="dock-label">Home</span>
    </button>
    <button class="dock-active">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">…</svg>
      <span class="dock-label">Search</span>
    </button>
    <button>
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">…</svg>
      <span class="dock-label">Mail</span>
    </button>
  </nav>
</div>
```


---

# Navbar

A bar across the top. Placement only — what goes in it is a menu, or buttons.

- Group: Layout
- Namespaces: `navbar`
- Svelte: `<Navbar>`
- Reference SCSS: [cosmos](reference/cosmos/navbar.scss), [dahlia](reference/dahlia/navbar.scss), [daisy](reference/daisy/navbar.scss), [peony](reference/peony/navbar.scss), [sunflower](reference/sunflower/navbar.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.navbar` | root | all | The component itself. |
| `.navbar-center` | part | all | A piece the component draws; never opted into. |
| `.navbar-end` | part | all | A piece the component draws; never opted into. |
| `.navbar-start` | part | all | A piece the component draws; never opted into. |
| `.navbar-lg` | axis size | all | Sets size to “lg”. |
| `.navbar-md` | axis size | all | Sets size to “md”. |
| `.navbar-sm` | axis size | all | Sets size to “sm”. |
| `.navbar-xl` | axis size | all | Sets size to “xl”. |
| `.navbar-xs` | axis size | all | Sets size to “xs”. |
| `.navbar-sticky` | flag (sticky) | all | Written by the sticky prop. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Navbar>`: `--navbar-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Navbar

```html
<nav class="navbar">
  <div class="navbar-start">
    <strong>Sepale</strong>
  </div>
  <div class="navbar-center">
    <ul class="menu menu-sm menu-horizontal">
      <li>
        <a class="menu-item menu-active" href="#demo" aria-current="page">Overview</a>
      </li>
      <li>
        <a class="menu-item" href="#demo">Docs</a>
      </li>
    </ul>
  </div>
  <div class="navbar-end">
    <button class="btn btn-primary btn-sm">Sign in</button>
  </div>
</nav>
```

### Zones are optional

```html
<nav class="navbar">
  <strong>Sepale</strong>
  <button class="btn btn-sm btn-ghost">Docs</button>
</nav>
```

### Sizes

```html
<div>
  <nav class="navbar navbar-xs">
    <div class="navbar-start">
      <strong>xs</strong>
    </div>
    <div class="navbar-end">
      <button class="btn btn-sm">Action</button>
    </div>
  </nav>
  <nav class="navbar navbar-sm">
    <div class="navbar-start">
      <strong>sm</strong>
    </div>
    <div class="navbar-end">
      <button class="btn btn-sm">Action</button>
    </div>
  </nav>
  <nav class="navbar navbar-md">
    <div class="navbar-start">
      <strong>md</strong>
    </div>
    <div class="navbar-end">
      <button class="btn btn-sm">Action</button>
    </div>
  </nav>
  <nav class="navbar navbar-lg">
    <div class="navbar-start">
      <strong>lg</strong>
    </div>
    <div class="navbar-end">
      <button class="btn btn-sm">Action</button>
    </div>
  </nav>
  <nav class="navbar navbar-xl">
    <div class="navbar-start">
      <strong>xl</strong>
    </div>
    <div class="navbar-end">
      <button class="btn btn-sm">Action</button>
    </div>
  </nav>
</div>
```


---

# Sidebar

An app's side column — a brand, a menu, an account — that folds to a rail. In the flow, unlike a Drawer: the page beside it narrows or widens, it is never covered. This app's own navigation is one.

- Group: Layout
- Namespaces: `sidebar`
- Svelte: `<Sidebar>`
- Reference SCSS: [cosmos](reference/cosmos/sidebar.scss), [dahlia](reference/dahlia/sidebar.scss), [daisy](reference/daisy/sidebar.scss), [peony](reference/peony/sidebar.scss), [sunflower](reference/sunflower/sidebar.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.sidebar` | root | all | The column, at --sidebar-width. |
| `.sidebar-body` | part | all | The scrolling middle: usually a .menu. |
| `.sidebar-collapsed` | part | all | Folded to --sidebar-rail: only the head's toggle stays, the rest fades out. |
| `.sidebar-foot` | part | all | The bottom row. |
| `.sidebar-head` | part | all | The top row: a brand, then the toggle. |
| `.sidebar-keep` | part | all | A head child kept on the rail (a logo). |
| `.sidebar-layout` | part | all | Optional: the full-height row of the sidebar and the page beside it. |
| `.sidebar-toggle` | part | all | The fold button. |
| `.sidebar-end` | axis side | all | On the end side of the page. |
| `.sidebar-lg` | axis size | all | Sets size to “lg”. |
| `.sidebar-md` | axis size | all | Sets size to “md”. |
| `.sidebar-sm` | axis size | all | Sets size to “sm”. |
| `.sidebar-xl` | axis size | all | Sets size to “xl”. |
| `.sidebar-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.sidebar-toggle`: `:focus-visible` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Sidebar>`: `--sidebar-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### App column

```html
<div class="sidebar-layout">
  <aside class="sidebar">
    <div class="sidebar-head">
      <strong>Orbit</strong>
      <button type="button" class="sidebar-toggle" aria-expanded="true" aria-controls="s1-body" aria-label="Collapse the sidebar" title="Collapse the sidebar">
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
      </button>
    </div>
    <div class="sidebar-body" id="s1-body">
      <ul class="menu">
        <li>
          <button type="button" class="menu-item menu-active">Dashboard</button>
        </li>
        <li>
          <button type="button" class="menu-item">Orders</button>
        </li>
        <li>
          <button type="button" class="menu-item menu-toggle" aria-expanded="true" aria-controls="s2-2">Catalogue</button>
          <ul id="s2-2" class="menu-sub">
            <li>  <!-- ×3 -->
              <button type="button" class="menu-item">Products</button>
            </li>
          </ul>
        </li>
        <li></li>
        <li>
          <button type="button" class="menu-item">Settings</button>
        </li>
      </ul>
    </div>
    <div class="sidebar-foot">
      <div class="avatar avatar-sm">
        <span>AL</span>
      </div>
      <span>Alex Laurent</span>
    </div>
  </aside>
  <main>
    <strong>The page</strong>
    <p>It narrows and widens with the sidebar: open.</p>
  </main>
</div>
```


---

# Drawer

A panel sliding in from any side, in three states: hidden, peek (its last --drawer-peek in view) and open (all --drawer-size of it). As a dialog, open is modal; as a nav or an aside it never blocks the page — a collapsible menu.

- Group: Layout
- Namespaces: `drawer`
- Svelte: `<Drawer>`
- Reference SCSS: [cosmos](reference/cosmos/drawer.scss), [dahlia](reference/dahlia/drawer.scss), [daisy](reference/daisy/drawer.scss), [peony](reference/peony/drawer.scss), [sunflower](reference/sunflower/drawer.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.drawer` | root | all | The panel. Its state is the data-state attribute: hidden, peek or open. Left by default. |
| `.drawer-content` | part | all | The content; scrolls. |
| `.drawer-handle` | part | all | A grip on the inner edge that toggles open and the rest state. |
| `.drawer-bottom` | axis side | all | Sets side to “bottom”. |
| `.drawer-left` | axis side | all | Sets side to “left”. |
| `.drawer-right` | axis side | all | Sets side to “right”. |
| `.drawer-top` | axis side | all | Sets side to “top”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.drawer`: `[data-state=hidden]` `[data-state=peek]`
- `.drawer-bottom`: `[data-state=hidden]` `[data-state=peek]`
- `.drawer-left`: `[data-state=hidden]` `[data-state=peek]`
- `.drawer-right`: `[data-state=hidden]` `[data-state=peek]`
- `.drawer-top`: `[data-state=hidden]` `[data-state=peek]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Drawer>`: `--drawer-bg`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Drawer>`: Finishes a change of state once the family's transition on the element has run, as long as its CSS says — at once if it draws none.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Peeking menu

```html
<div style="--drawer-position:absolute">
  <nav style="--drawer-size: 14em; --drawer-peek: 3.5em" class="drawer" data-state="peek">
    <div class="drawer-content">
      <ul class="menu">
        <li>  <!-- ×3 -->
          <button type="button" class="menu-item">Home</button>
        </li>
      </ul>
    </div>
    <button type="button" class="drawer-handle" aria-label="Toggle panel" aria-expanded="false"></button>
  </nav>
  <div>
    <button class="btn btn-sm">open()</button>  <!-- ×3 -->
    <span>state: peek</span>
  </div>
</div>
```

### Bottom sheet

```html
<div style="--drawer-position:absolute">
  <div>
    <button class="btn btn-sm">Toggle the sheet</button>
  </div>
  <div style="--drawer-size: 12em" class="drawer drawer-bottom" data-state="hidden" inert="" role="region">
    <div class="drawer-content">
      <p>A sheet from the bottom edge. Escape closes it.</p>
    </div>
  </div>
</div>
```

### Modal, from the right

```html
<button class="btn">Open the panel</button>
<dialog style="--drawer-position: fixed" class="drawer drawer-right" data-state="hidden">
  <div class="drawer-content">
    <div>
      <strong>Filters</strong>
      <p>The page behind is inert while this is open.</p>
      <button class="btn">Done</button>
    </div>
  </div>
</dialog>
```


---

# Footer

The closing block of a page: columns of links that fill the width as room allows, then a bottom row.

- Group: Layout
- Namespaces: `footer`
- Svelte: `<Footer>`
- Reference SCSS: [cosmos](reference/cosmos/footer.scss), [dahlia](reference/dahlia/footer.scss), [daisy](reference/daisy/footer.scss), [peony](reference/peony/footer.scss), [sunflower](reference/sunflower/footer.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.footer` | root | all | The block. |
| `.footer-bottom` | part | all | The last row, under a rule. |
| `.footer-section` | part | all | One column. |
| `.footer-sections` | part | all | The columns, as an auto-fit grid. |
| `.footer-title` | part | all | A column heading. |
| `.footer-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.footer-error` | axis color | all | Sets color to “error”. |
| `.footer-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.footer-neutral` | axis color | all | Sets color to “neutral”. |
| `.footer-primary` | axis color | all | Sets color to “primary”. |
| `.footer-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.footer-success` | axis color | all | Sets color to “success”. |
| `.footer-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.footer-center` | flag (center) | all | Written by the center prop. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Footer>`: `--footer-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Columns and bottom row

```html
<div>
  <footer class="footer">
    <div class="footer-sections">
      <nav class="footer-section" aria-label="Product">
        <h2 class="footer-title">Product</h2>
        <a href="#pricing">Pricing</a>
        <a href="#changelog">Changelog</a>
      </nav>
      <nav class="footer-section" aria-label="Company">
        <h2 class="footer-title">Company</h2>
        <a href="#about">About</a>
        <a href="#careers">Careers</a>
      </nav>
      <nav class="footer-section" aria-label="Legal">
        <h2 class="footer-title">Legal</h2>
        <a href="#privacy">Privacy</a>
        <a href="#terms">Terms</a>
      </nav>
    </div>
    <div class="footer-bottom">
      <span>© 2026 Sepale</span>  <!-- ×2 -->
    </div>
  </footer>
</div>
```

### Centered, colored

```html
<div>
  <footer class="footer footer-neutral footer-center">
    <div class="footer-bottom">
      <span>© 2026 Sepale</span>
    </div>
  </footer>
</div>
```


---

# Hero

The large opening block of a page: a title, a sentence, a call to action, and optionally media beside them. Stacks by itself when there is no room — no breakpoint.

- Group: Layout
- Namespaces: `hero`
- Svelte: `<Hero>`
- Reference SCSS: [cosmos](reference/cosmos/hero.scss), [dahlia](reference/dahlia/hero.scss), [daisy](reference/daisy/hero.scss), [peony](reference/peony/hero.scss), [sunflower](reference/sunflower/hero.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.hero` | root | all | A wrapping row: content and media. |
| `.hero-actions` | part | all | The calls to action. |
| `.hero-body` | part | all | The sentence. |
| `.hero-content` | part | all | Title, body and actions. |
| `.hero-media` | part | all | An image, a video, an illustration. |
| `.hero-title` | part | all | The heading. |
| `.hero-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.hero-error` | axis color | all | Sets color to “error”. |
| `.hero-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.hero-lg` | axis size | all | Sets size to “lg”. |
| `.hero-md` | axis size | all | Sets size to “md”. |
| `.hero-neutral` | axis color | all | Sets color to “neutral”. |
| `.hero-primary` | axis color | all | Sets color to “primary”. |
| `.hero-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.hero-sm` | axis size | all | Sets size to “sm”. |
| `.hero-success` | axis color | all | Sets color to “success”. |
| `.hero-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.hero-xl` | axis size | all | Sets size to “xl”. |
| `.hero-xs` | axis size | all | Sets size to “xs”. |
| `.hero-center` | flag (center) | all | Written by the center prop. |
| `.hero-reverse` | flag (reverse) | all | Written by the reverse prop. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Hero>`: `--hero-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### With media

```html
<div>
  <section class="hero">
    <div class="hero-content">
      <h2 class="hero-title">Ship interfaces, not stylesheets</h2>
      <p class="hero-body">Components first; a family gives them a look.</p>
      <div class="hero-actions">
        <button class="btn btn-primary">Get started</button>
        <button class="btn">Docs</button>
      </div>
    </div>
    <div class="hero-media">
      <svg viewBox="0 0 320 200" role="img" aria-label="Illustration">…</svg>
    </div>
  </section>
</div>
```

### Centered, colored

```html
<div>
  <section class="hero hero-primary hero-center">
    <div class="hero-content">
      <h2 class="hero-title">Spring sale</h2>
      <p class="hero-body">Everything at half price until Sunday.</p>
      <div class="hero-actions">
        <button class="btn">Shop now</button>
      </div>
    </div>
  </section>
</div>
```


---

# Divider

A rule between two things, horizontal or vertical, optionally carrying a word or two. Its shapes — dashed, dotted, thick, fading — are each family's own.

- Group: Layout
- Namespaces: `divider`
- Svelte: `<Divider>`
- Reference SCSS: [cosmos](reference/cosmos/divider.scss), [dahlia](reference/dahlia/divider.scss), [daisy](reference/daisy/divider.scss), [peony](reference/peony/divider.scss), [sunflower](reference/sunflower/divider.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.divider` | root | all | Two lines around the content; one line when empty (and on an <hr>). |
| `.divider-content` | part | all | The words between the lines. |
| `.divider-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.divider-center` | axis align | all | Sets align to “center”. |
| `.divider-dashed` | axis variant | cosmos, dahlia, sunflower | Sets variant to “dashed”. |
| `.divider-dotted` | axis variant | dahlia | Sets variant to “dotted”. |
| `.divider-end` | axis align | all | Sets align to “end”. |
| `.divider-error` | axis color | all | Sets color to “error”. |
| `.divider-fade` | axis variant | peony | Sets variant to “fade”. |
| `.divider-horizontal` | axis direction | all | Sets direction to “horizontal”. |
| `.divider-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.divider-neutral` | axis color | all | Sets color to “neutral”. |
| `.divider-primary` | axis color | all | Sets color to “primary”. |
| `.divider-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.divider-start` | axis align | all | Sets align to “start”. |
| `.divider-success` | axis color | all | Sets color to “success”. |
| `.divider-thick` | axis variant | sunflower | Sets variant to “thick”. |
| `.divider-vertical` | axis direction | all | Sets direction to “vertical”. |
| `.divider-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.divider`: `:empty`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Plain and with content

```html
<div>
  <hr class="divider">
  <div class="divider" role="separator" aria-orientation="horizontal">
    <span class="divider-content">or</span>
  </div>
  <div class="divider divider-start" role="separator" aria-orientation="horizontal">
    <span class="divider-content">Start</span>
  </div>
  <div class="divider divider-end" role="separator" aria-orientation="horizontal">
    <span class="divider-content">End</span>
  </div>
</div>
```

### Colors

```html
<div>
  <div class="divider divider-primary" role="separator" aria-orientation="horizontal">
    <span class="divider-content">Primary</span>
  </div>
  <div class="divider divider-error" role="separator" aria-orientation="horizontal">
    <span class="divider-content">Error</span>
  </div>
</div>
```

### Dashed

```html
<div>
  <div class="divider divider-dashed" role="separator" aria-orientation="horizontal">
    <span class="divider-content">Dashed</span>
  </div>
</div>
```

### Dotted

```html
<div>
  <div class="divider divider-dotted" role="separator" aria-orientation="horizontal">
    <span class="divider-content">Dotted</span>
  </div>
</div>
```

### Thick

```html
<div>
  <div class="divider divider-thick" role="separator" aria-orientation="horizontal">
    <span class="divider-content">Thick</span>
  </div>
</div>
```

### Fade

```html
<div>
  <div class="divider divider-fade" role="separator" aria-orientation="horizontal">
    <span class="divider-content">Fade</span>
  </div>
</div>
```

### Vertical

```html
<div>
  <span>Left</span>
  <hr class="divider divider-vertical" aria-orientation="vertical">
  <span>Middle</span>
  <div class="divider divider-vertical" role="separator" aria-orientation="vertical">
    <span class="divider-content">or</span>
  </div>
  <span>Right</span>
</div>
```


---

# Collapse

A panel that folds under its trigger. A button and a region, not <details>: the height animates and the state is the button's aria-expanded. Stack several in an Accordion.

- Group: Layout
- Namespaces: `collapse`
- Svelte: `<Collapse>`
- Reference SCSS: [cosmos](reference/cosmos/collapse.scss), [dahlia](reference/dahlia/collapse.scss), [daisy](reference/daisy/collapse.scss), [peony](reference/peony/collapse.scss), [sunflower](reference/sunflower/collapse.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.collapse` | root | all | The frame; two grid rows, the second folding from 0fr to 1fr. |
| `.collapse-inner` | part | all | The padding inside the panel (the panel itself must stay unpadded to fold to zero). |
| `.collapse-panel` | part | all | The region that folds; inert when closed. |
| `.collapse-trigger` | part | all | The button. Its aria-expanded is the state the stylesheet reads. |
| `.collapse-ghost` | axis variant | all | Sets variant to “ghost”. |
| `.collapse-lg` | axis size | none yet | Sets size to “lg”. |
| `.collapse-md` | axis size | none yet | Sets size to “md”. |
| `.collapse-sm` | axis size | none yet | Sets size to “sm”. |
| `.collapse-xl` | axis size | none yet | Sets size to “xl”. |
| `.collapse-xs` | axis size | none yet | Sets size to “xs”. |
| `.collapse-arrow` | flag (arrow) | all | Written by the arrow prop. |
| `.collapse-plus` | flag (plus) | all | Written by the plus prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.collapse-trigger`: `:focus-visible` `:hover` `[aria-expanded=true]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Collapse>`: `--collapse-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Plain, arrow, plus

```html
<div>
  <div class="collapse">
    <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-pdgtaor">Plain</button>
    <div class="collapse-panel" id="collapse-pdgtaor" role="region" inert="">
      <div class="collapse-inner">Delivered in three to five working days.</div>
    </div>
  </div>
  <div class="collapse collapse-arrow">
    <button type="button" class="collapse-trigger" aria-expanded="true" aria-controls="collapse-ipgyvs4">Arrow</button>
    <div class="collapse-panel" id="collapse-ipgyvs4" role="region">
      <div class="collapse-inner">Opens on load. Returns are free for thirty days.</div>
    </div>
  </div>
  <div class="collapse collapse-plus">
    <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-ese0oeb">Plus</button>
    <div class="collapse-panel" id="collapse-ese0oeb" role="region" inert="">
      <div class="collapse-inner">Gift wrapping is available at checkout.</div>
    </div>
  </div>
</div>
```

### Ghost

```html
<div>
  <div class="collapse collapse-ghost collapse-arrow">
    <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-gmv7p9a">No frame</button>
    <div class="collapse-panel" id="collapse-gmv7p9a" role="region" inert="">
      <div class="collapse-inner">The trigger and the content sit on the page.</div>
    </div>
  </div>
</div>
```

### Driven from outside

```html
<div>
  <div>
    <button class="btn btn-sm">Show</button>  <!-- ×3 -->
    <span>onopen: closed</span>
  </div>
  <div class="collapse collapse-arrow">
    <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-px10rj0">Remote</button>
    <div class="collapse-panel" id="collapse-px10rj0" role="region" inert="">
      <div class="collapse-inner">Opened by a button elsewhere.</div>
    </div>
  </div>
</div>
```


---

# Accordion

A stack of Collapses, joined at their edges. With exclusive, opening one closes the others.

- Group: Layout
- Namespaces: `accordion`
- Svelte: `<Accordion>`
- Reference SCSS: [cosmos](reference/cosmos/accordion.scss), [dahlia](reference/dahlia/accordion.scss), [daisy](reference/daisy/accordion.scss), [peony](reference/peony/accordion.scss), [sunflower](reference/sunflower/accordion.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.accordion` | root | all | The stack; joins its collapses so only the outer corners are rounded. |
| `.accordion-separate` | flag (separate) | all | Written by the separate prop. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Joined, exclusive

```html
<div>
  <div class="accordion">
    <div class="collapse collapse-arrow">
      <button type="button" class="collapse-trigger" aria-expanded="true" aria-controls="collapse-76d1uq7">Shipping</button>
      <div class="collapse-panel" id="collapse-76d1uq7" role="region">
        <div class="collapse-inner">Three to five working days.</div>
      </div>
    </div>
    <div class="collapse collapse-arrow">
      <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-6xabqgz">Returns</button>
      <div class="collapse-panel" id="collapse-6xabqgz" role="region" inert="">
        <div class="collapse-inner">Free for thirty days.</div>
      </div>
    </div>
    <div class="collapse collapse-arrow">
      <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-8y983kk">Warranty</button>
      <div class="collapse-panel" id="collapse-8y983kk" role="region" inert="">
        <div class="collapse-inner">Two years, parts and labour.</div>
      </div>
    </div>
  </div>
</div>
```

### Separate

```html
<div>
  <div class="accordion accordion-separate">
    <div class="collapse collapse-plus">
      <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-fcvwg3m">One</button>
      <div class="collapse-panel" id="collapse-fcvwg3m" role="region" inert="">
        <div class="collapse-inner">First.</div>
      </div>
    </div>
    <div class="collapse collapse-plus">
      <button type="button" class="collapse-trigger" aria-expanded="false" aria-controls="collapse-93dsrcl">Two</button>
      <div class="collapse-panel" id="collapse-93dsrcl" role="region" inert="">
        <div class="collapse-inner">Second.</div>
      </div>
    </div>
  </div>
</div>
```


---

# Dialog

A box laid over the page, built on the native <dialog>. Modal, the page behind is shaded by the browser’s own ::backdrop and cannot be reached; not modal, it stays usable.

- Group: Overlay
- Namespaces: `dialog`
- Svelte: `<Dialog>`
- Reference SCSS: [cosmos](reference/cosmos/dialog.scss), [dahlia](reference/dahlia/dialog.scss), [daisy](reference/daisy/dialog.scss), [peony](reference/peony/dialog.scss), [sunflower](reference/sunflower/dialog.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.dialog` | root | all | The component itself. |
| `.dialog-actions` | part | all | The buttons, at the end of the box. A <form method="dialog">: a button closes the dialog with its value. |
| `.dialog-body` | part | all | What the dialog says or asks. |
| `.dialog-box` | part | all | The box itself. Everything around it is the overlay: a click there lands on the <dialog>. |
| `.dialog-close` | part | all | The close button in the corner. |
| `.dialog-title` | part | all | The heading. |
| `.dialog-bottom` | axis placement | all | Sets placement to “bottom”. |
| `.dialog-lg` | axis size | all | Sets size to “lg”. |
| `.dialog-md` | axis size | all | Sets size to “md”. |
| `.dialog-sm` | axis size | all | Sets size to “sm”. |
| `.dialog-top` | axis placement | all | Sets placement to “top”. |
| `.dialog-xl` | axis size | all | Sets size to “xl”. |
| `.dialog-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.dialog`: `:modal` `[open]`
- `.dialog-box`: `[data-motion=enter]` `[data-motion=leave]`
- `.dialog-close`: `:focus-visible` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Dialog>`: `--dialog-bg` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Dialog>`: `.dialog-box` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<Dialog>`: `.dialog-box` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<Dialog>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### A confirmation

```html
<button class="btn">Delete…</button>
<dialog class="dialog" aria-labelledby="s1-title"></dialog>
```

### A form, no way out but its buttons

```html
<button class="btn">Rename…</button>
<dialog class="dialog dialog-sm" aria-labelledby="s2-title"></dialog>
```

### Placement, and not modal

```html
<button class="btn">At the top</button>  <!-- ×2 -->
<dialog class="dialog dialog-top" aria-labelledby="s3-title"></dialog>
<dialog class="dialog dialog-bottom" aria-labelledby="s4-title"></dialog>
```


---

# Dropdown

A trigger and a box that floats next to it — a menu, a filter, a small form. The Svelte component places the box in fixed coordinates, so no scrolling ancestor crops it, and flips it when there is no room.

- Group: Overlay
- Namespaces: `dropdown`
- Svelte: `<Dropdown>`
- Reference SCSS: [cosmos](reference/cosmos/dropdown.scss), [dahlia](reference/dahlia/dropdown.scss), [daisy](reference/daisy/dropdown.scss), [peony](reference/peony/dropdown.scss), [sunflower](reference/sunflower/dropdown.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.dropdown` | root | all | The component itself. |
| `.dropdown-content` | part | all | The floating box. |
| `.dropdown-fixed` | part | all | The box is placed in fixed coordinates by a script, and only shown when open. |
| `.dropdown-open` | part | all | Shows the box. Written by the component; a <details open> or focus inside does the same without a script. |
| `.dropdown-bottom` | axis side | none yet | Sets side to “bottom”. |
| `.dropdown-center` | axis align | all | Sets align to “center”. |
| `.dropdown-end` | axis align | all | Sets align to “end”. |
| `.dropdown-left` | axis side | all | Sets side to “left”. |
| `.dropdown-lg` | axis size | all | Sets size to “lg”. |
| `.dropdown-md` | axis size | all | Sets size to “md”. |
| `.dropdown-right` | axis side | all | Sets side to “right”. |
| `.dropdown-sm` | axis size | all | Sets size to “sm”. |
| `.dropdown-top` | axis side | all | Sets side to “top”. |
| `.dropdown-xl` | axis size | all | Sets size to “xl”. |
| `.dropdown-xs` | axis size | all | Sets size to “xs”. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.dropdown`: `:focus-within` `[open]`
- `.dropdown-content`: `[data-motion=enter]` `[data-motion=leave]`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Dropdown>`: `--dropdown-bg` `--motion-h` `--motion-w`

## Motion

What the component animates itself, and what it waits for from the family.

- `<Dropdown>`: `.dropdown-content` is marked `data-motion="enter"` when inserted, while the family's animation on it runs (`--motion-w/h`: its size). Nothing drawn: it appears at once.
- `<Dropdown>`: `.dropdown-content` is marked `data-motion="leave"` and stays in the DOM until the family's transitions and animations on it have run (`--motion-w/h`: its size). Nothing drawn: it goes at once.
- `<Dropdown>`: The `transition` prop hands the coming and going to a Svelte transition instead (`fly`, `{ fn, params }`, `{ in, out }`): no phase is marked then. `false`: instant.

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### A menu

```html
<div class="dropdown dropdown-fixed">
  <button aria-expanded="false" aria-controls="s1-content" aria-haspopup="true" class="btn">Sort: Newest</button>
</div>
```

### Sides and alignment

```html
<div class="dropdown dropdown-bottom dropdown-end dropdown-fixed">
  <button aria-expanded="false" aria-controls="s2-content" aria-haspopup="true" class="btn btn-outline">bottom · end</button>
</div>
<div class="dropdown dropdown-top dropdown-fixed">
  <button aria-expanded="false" aria-controls="s3-content" aria-haspopup="true" class="btn btn-outline">top</button>
</div>
<div class="dropdown dropdown-right dropdown-fixed">
  <button aria-expanded="false" aria-controls="s4-content" aria-haspopup="true" class="btn btn-outline">right</button>
</div>
<div class="dropdown dropdown-left dropdown-end dropdown-fixed">
  <button aria-expanded="false" aria-controls="s5-content" aria-haspopup="true" class="btn btn-outline">left · end</button>
</div>
```


---

# Tooltip

A short hint beside its trigger, shown on hover and on keyboard focus. Pure CSS: it does not reposition itself to stay on screen, so pick the side that has room.

- Group: Overlay
- Namespaces: `tooltip`
- Svelte: `<Tooltip>`
- Reference SCSS: [cosmos](reference/cosmos/tooltip.scss), [dahlia](reference/dahlia/tooltip.scss), [daisy](reference/daisy/tooltip.scss), [peony](reference/peony/tooltip.scss), [sunflower](reference/sunflower/tooltip.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.tooltip` | root | all | Wraps the trigger; the bubble shows on :hover and :focus-within. |
| `.tooltip-content` | part | all | The bubble, with its arrow. |
| `.tooltip-accent` | axis color | cosmos, dahlia, daisy | Sets color to “accent”. |
| `.tooltip-bottom` | axis side | all | Sets side to “bottom”. |
| `.tooltip-error` | axis color | all | Sets color to “error”. |
| `.tooltip-info` | axis color | cosmos, dahlia, daisy, peony | Sets color to “info”. |
| `.tooltip-left` | axis side | all | Sets side to “left”. |
| `.tooltip-neutral` | axis color | all | Sets color to “neutral”. |
| `.tooltip-primary` | axis color | all | Sets color to “primary”. |
| `.tooltip-right` | axis side | all | Sets side to “right”. |
| `.tooltip-secondary` | axis color | cosmos, dahlia, daisy | Sets color to “secondary”. |
| `.tooltip-success` | axis color | all | Sets color to “success”. |
| `.tooltip-top` | axis side | all | Sets side to “top”. |
| `.tooltip-warning` | axis color | cosmos, dahlia, daisy, peony | Sets color to “warning”. |
| `.tooltip-float` | flag (float) | all | Written by the float prop. |
| `.tooltip-open` | flag (open) | all | Written by the open prop. |

## States

What the DOM says about itself, as the built families draw it. Give each a visible answer.

- `.tooltip`: `:focus-within` `:hover`

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<Tooltip>`: `--tooltip-anchor` `--tooltip-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Sides

```html
<div>
  <span class="tooltip tooltip-top" style="--tooltip-anchor: --tooltip-9sy7srm">
    <button class="btn">Top</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-9sy7srm">On top</span>
  </span>
  <span class="tooltip tooltip-right" style="--tooltip-anchor: --tooltip-nsgd8l9">
    <button class="btn">Right</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-nsgd8l9">On the right</span>
  </span>
  <span class="tooltip tooltip-bottom" style="--tooltip-anchor: --tooltip-s32ky1z">
    <button class="btn">Bottom</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-s32ky1z">Below</span>
  </span>
  <span class="tooltip tooltip-left" style="--tooltip-anchor: --tooltip-51q2w4h">
    <button class="btn">Left</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-51q2w4h">On the left</span>
  </span>
</div>
```

### Open and colored

```html
<div>
  <span class="tooltip tooltip-open" style="--tooltip-anchor: --tooltip-c2zbk9u">
    <button class="btn">Open</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-c2zbk9u">Always shown</span>
  </span>
  <span class="tooltip tooltip-success tooltip-open" style="--tooltip-anchor: --tooltip-x6wo5f7">
    <button class="btn">Success</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-x6wo5f7">Saved</span>
  </span>
  <span class="tooltip tooltip-bottom tooltip-error tooltip-open" style="--tooltip-anchor: --tooltip-lh5sdkq">
    <button class="btn">Error</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-lh5sdkq">Careful</span>
  </span>
</div>
```

### Float

```html
<div>
  <span class="tooltip" style="--tooltip-anchor: --tooltip-f2tm30n">
    <button class="btn">Plain</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-f2tm30n">Clipped by the box</span>
  </span>
  <span class="tooltip tooltip-float" style="--tooltip-anchor: --tooltip-cqurnic">
    <button class="btn">Float</button>
    <span class="tooltip-content" role="tooltip" id="tooltip-cqurnic">I escape the box</span>
  </span>
</div>
```


---

# Mobile frame

A phone drawn around content, for showcases and screenshots — not an emulator. Set --mobile-frame-width; the height follows.

- Group: Mockups
- Namespaces: `mobile-frame`
- Svelte: `<MobileFrame>`
- Reference SCSS: [cosmos](reference/cosmos/mobile-frame.scss), [dahlia](reference/dahlia/mobile-frame.scss), [daisy](reference/daisy/mobile-frame.scss), [peony](reference/peony/mobile-frame.scss), [sunflower](reference/sunflower/mobile-frame.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.mobile-frame` | root | all | The body, with its island and side button. |
| `.mobile-frame-screen` | part | all | The screen; scrolls its content. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Phone

```html
<div class="mobile-frame">
  <div class="mobile-frame-screen">
    <div>
      <strong>Inbox</strong>
      <div class="alert alert-info" role="status">
        <span class="alert-icon" aria-hidden="true">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
        </span>
        <div class="alert-body">Three new messages.</div>
      </div>
      <div class="alert alert-success" role="status">
        <span class="alert-icon" aria-hidden="true">
          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">…</svg>
        </span>
        <div class="alert-body">Backup complete.</div>
      </div>
    </div>
  </div>
</div>
<div style="--mobile-frame-width: 12em" class="mobile-frame">
  <div class="mobile-frame-screen">
    <div>Smaller.</div>
  </div>
</div>
```


---

# Window frame

An application window drawn around content: a title bar with three controls, a title and actions, above a body that scrolls.

- Group: Mockups
- Namespaces: `window-frame`
- Svelte: `<WindowFrame>`
- Reference SCSS: [cosmos](reference/cosmos/window-frame.scss), [dahlia](reference/dahlia/window-frame.scss), [daisy](reference/daisy/window-frame.scss), [peony](reference/peony/window-frame.scss), [sunflower](reference/sunflower/window-frame.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.window-frame` | root | all | The window. |
| `.window-frame-actions` | part | all | Buttons on the right of the bar. |
| `.window-frame-bar` | part | all | The title bar. |
| `.window-frame-body` | part | all | The content; scrolls. |
| `.window-frame-controls` | part | all | The three window controls. |
| `.window-frame-title` | part | all | The centred title. |

## Custom properties the component writes

Inputs for the family to read; the component sets them inline.

- `<WindowFrame>`: `--window-frame-bg`

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Window

```html
<div>
  <div class="window-frame">
    <div class="window-frame-bar">
      <span class="window-frame-controls" aria-hidden="true">
        <span></span>  <!-- ×3 -->
      </span>
      <span class="window-frame-title">Settings</span>
      <span class="window-frame-actions">
        <button class="btn btn-xs">Share</button>
      </span>
    </div>
    <div class="window-frame-body">
      <div>The window's content.</div>
    </div>
  </div>
</div>
```


---

# Laptop frame

A laptop drawn around content: a lid holding a 16:10 screen that scrolls, on a wider base. Set --laptop-frame-width.

- Group: Mockups
- Namespaces: `laptop-frame`
- Svelte: `<LaptopFrame>`
- Reference SCSS: [cosmos](reference/cosmos/laptop-frame.scss), [dahlia](reference/dahlia/laptop-frame.scss), [daisy](reference/daisy/laptop-frame.scss), [peony](reference/peony/laptop-frame.scss), [sunflower](reference/sunflower/laptop-frame.scss)

## Classes

| Class | Kind | Built families shipping it | What it does |
| --- | --- | --- | --- |
| `.laptop-frame` | root | all | The device. |
| `.laptop-frame-base` | part | all | The base, with its notch. |
| `.laptop-frame-lid` | part | all | The lid, with its camera. |
| `.laptop-frame-screen` | part | all | The 16:10 screen; scrolls. |

## DOM

What each example renders on the server, before any script runs. Svelte markers removed; siblings shaped alike folded into one marked `×n`; only custom properties kept from `style`. Classes not in this page's namespaces belong to the demo or to another component.

### Laptop

```html
<div class="laptop-frame">
  <div class="laptop-frame-lid">
    <div class="laptop-frame-screen">
      <section class="hero hero-sm">
        <div class="hero-content">
          <h2 class="hero-title">Hello</h2>
          <p class="hero-body">A page inside a laptop.</p>
        </div>
      </section>
    </div>
  </div>
  <div class="laptop-frame-base" aria-hidden="true"></div>
</div>
```
