npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pyaella/workshop

v0.2.0

Published

The Workshop design system: Svelte 5 components styled only with Tailwind CSS 4.

Readme

@pyaella/workshop

The Workshop design system as Svelte 5 components, styled only with Tailwind CSS 4. Self-contained: no runtime dependencies, only the svelte and tailwindcss peers. What changed in each version: CHANGELOG.md, shipped with the package. Licence: MIT, the artwork included (LICENSE).

Use it in an app

npm install @pyaella/workshop

In the app's Tailwind 4 stylesheet (with @tailwindcss/vite):

@import "tailwindcss";
@import "@pyaella/workshop/theme.css";
<script>
  import { Button, Link, Prose } from "@pyaella/workshop";
</script>

<Button onclick={validate} {pending}>Validate contract</Button>
<Link href="/docs">Read the manual</Link>
<Prose as="article">{@html body}</Prose>

theme.css brings three things:

  • The tokens, as Tailwind theme variables, so bg-canvas, text-ink, border-line, rounded-card, shadow-paper, max-w-reading, font-display and text-display-1 are ordinary utilities in the app.
  • A small base layer: body colours and font, focus ring, selection and reduced motion.
  • The component recipes, in sublayers of @layer components.

It also tells the app's build to scan this package for class names (@source), because Tailwind skips node_modules by default. An app that uses part of the catalog can import less: see Stylesheets.

Fonts

The package names its faces (Inter, Fraunces and IBM Plex Mono) but ships no font file and depends on no font package. Without them, a reader gets the face if their machine has it, or the system fallback. To load them, install the Fontsource packages and import them once, in the app's root layout:

npm install @fontsource-variable/inter @fontsource-variable/fraunces @fontsource/ibm-plex-mono
import "@fontsource-variable/inter";
import "@fontsource-variable/fraunces/opsz.css";
import "@fontsource/ibm-plex-mono/400.css";
import "@fontsource/ibm-plex-mono/500.css";

The variable packages register "Inter Variable" and "Fraunces Variable", which the stacks name first.

Stylesheets: the whole catalog, or what you use

theme.css is the whole catalog. An app that uses part of it can import css/core.css and then one entry per group it uses, and pays only for those:

@import "tailwindcss";
@import "@pyaella/workshop/css/core.css";
@import "@pyaella/workshop/css/forms.css";
@import "@pyaella/workshop/css/anchored.css";
@import "@pyaella/workshop/css/selection.css";
  • core.css holds the tokens, the base layer and the dark variant. Every entry declares the order the groups cascade in, so the entries may come in any order.
  • An entry that needs another fails the build without it, by name: leave out anchored.css beside menus.css and the app's build stops with "Cannot apply unknown utility class wk-entry-anchored". Add the entry it names. Nothing can check that you imported the entry of a component you render: without it, the component draws unstyled, so use the table below.
  • Import each entry once. Tailwind does not deduplicate a stylesheet imported twice, so the entries never import each other.
  • Each entry scans only its own components for class names (@source).
  • CommandDialog is a Dialog: it also needs css/overlays.css, which no marker can require of one component.
  • Every recipe sits in a sublayer of @layer components (components.core, components.forms, ...). A utility you pass still wins over it. A rule you write in your own @layer components wins over every recipe whatever its specificity (it sits after the sublayers), where before the split it competed on specificity.

| Entry | What | Components | Needs (besides core) | |---|---|---|---| | css/core.css | tokens, the base layer, the dark variant, and the content components | Alert, AspectRatio, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Card, Empty, Eyebrow, Heading, Icon, Item, Kbd, Lede, Link, Pagination, Progress, Prose, Separator, Skeleton, Spinner, Status, Table, Text | — | | css/forms.css | form controls | Checkbox, Field, Input, InputGroup, Label, NativeSelect, RadioGroup, Slider, Switch, Textarea, Toggle | — | | css/site.css | site patterns | CtaBand, FeatureGrid, Hero, Section, SiteFooter, SiteHeader, SkipLink, ThemeScript, ThemeToggle, Wordmark | — | | css/journal.css | journal patterns | ArticleLayout, Byline, CodeBlock, Figure, FootnoteRef, Footnotes, PostCard, PostList, TableOfContents, TagList | — | | css/overlays.css | modal overlays | AlertDialog, Dialog, Drawer, Sheet | — | | css/anchored.css | anchored overlays and toasts | HoverCard, Popover, Toaster, Tooltip | — | | css/disclosure.css | disclosure and navigation | Accordion, AccordionItem, Collapsible, NavigationMenu, ScrollArea, Sidebar, Tabs | anchored.css | | css/menus.css | menus and command | Command, CommandDialog, ContextMenu, DropdownMenu, Menubar | anchored.css | | css/selection.css | selection | Combobox, InputOTP, Select, ToggleGroup | forms.css, anchored.css | | css/dates.css | dates | Calendar, DatePicker, RangeCalendar | forms.css | | css/data-table.css | the data table | DataTable | forms.css | | css/workspace.css | workspace | Carousel, Chart, Resizable | — | | css/agent.css | the transcript | Attachment, Bubble, Marker, Message, Trace | — | | css/converse.css | the behaviours | MessageScroller, Questionnaire | agent.css, forms.css |

Components

| Group | Components | |---|---| | Actions and links | Button, ButtonGroup, Link | | Typography | Heading, Text, Eyebrow, Lede, Prose | | Metadata | Badge, Status, Kbd, Avatar, Icon plus icon* data (iconCheck, iconAlert, ...) | | Surfaces | Card, Item, Separator, AspectRatio | | Data and navigation | Table, Breadcrumb | | Feedback | Alert, Empty, Progress, Spinner, Skeleton | | Forms | Field, Label, Input, Textarea, InputGroup, NativeSelect, Slider, Checkbox, RadioGroup, Switch, Toggle | | Site | SiteHeader, SiteFooter, SkipLink, Wordmark, Hero, Section, FeatureGrid, CtaBand, ThemeToggle, ThemeScript | | Artwork | Artwork, ArchitectureCard, and 29 illustrations from @pyaella/workshop/art/<family>-<id> | | Overlays | Dialog, AlertDialog, Sheet, Drawer | | Anchored overlays | Popover, Tooltip, HoverCard, Toaster and toast() | | Disclosure and navigation | Collapsible, Accordion, AccordionItem, Tabs, NavigationMenu, Sidebar, ScrollArea | | Menus and command | DropdownMenu, ContextMenu, Menubar, Command, CommandDialog | | Selection | Select, Combobox, ToggleGroup, InputOTP | | Dates | Calendar, RangeCalendar, DatePicker | | Data | DataTable | | Workspace | Chart, Carousel, Resizable | | Agent and collaboration | Message, Bubble, Marker, Attachment, Trace, MessageScroller, Questionnaire | | Journal | ArticleLayout, PostCard, PostList, TableOfContents, Byline, TagList, Pagination, Figure, FootnoteRef, Footnotes, CodeBlock, and readingMinutes() |

Every one is a named export of @pyaella/workshop; the gallery (npm run dev) shows each variant in both themes.

Themes

With no attribute, a page follows the reader's system preference, and no script is needed for that. To pin a theme, set data-theme="day" or data-theme="night" on <html>, or on any element to pin just that subtree. A night band inside a day page is just an attribute: an element with data-theme="day" or "night" paints its own theme's canvas and ink (your classes on it win; inside a Card or a panel, that means a canvas patch, so add bg-transparent if you want the surface to show). The tokens are exact at any depth of nesting. The dark: variant follows the nearest data-theme too, exact to three levels counting a pinned root (a night page, a day panel, a night card inside it), because selectors cannot express "nearest ancestor" at any depth.

To let readers pin a theme, put <ThemeScript /> in the root layout (it applies a stored pin before first paint) and a <ThemeToggle /> in the header. followSystem() drops the pin. Under SvelteKit's CSP:

// vite.config.js, hash mode
import { THEME_SCRIPT_HASH } from "@pyaella/workshop/theme";
sveltekit({ csp: { mode: "hash", directives: { "script-src": ["self", THEME_SCRIPT_HASH] } } });

Styles: the package works under a strict style-src 'self', with no 'unsafe-inline'. No component writes a style attribute. A value from your data reaches the page in one of three ways:

  • a preset in the stylesheet: Progress's fill (one per whole percent), Resizable's size;
  • an attribute that is not a style: AspectRatio's ratio is an SVG viewBox;
  • the CSSOM once the page is live, which the policy allows: Avatar's photo, so until then (and with no JavaScript) an Avatar is its initials.

A style attribute you pass yourself is yours, so prefer a class (class="[--wk-anchored-max:16rem]"). Two lines of SvelteKit's own carry inline styles that such a policy refuses:

  • app.html's <div style="display: contents">: write <div class="contents">.
  • The route announcer, #svelte-announcer: restate its style in your CSS, or after a client-side navigation it shows the page's title:
#svelte-announcer {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

The browser still reports the announcer's refused attribute; that report is SvelteKit's, not the package's.

In nonce mode SvelteKit gives components no nonce: put the script in app.html instead, <script nonce="%sveltekit.nonce%">…</script>, with the text of themeScript(THEME_KEY). If the script cannot run at all, the toggle still applies a stored pin once hydrated. The exported hash covers the default storage key; with your own storageKey, hash themeScript(storageKey) yourself. Use one storage key per page.

Changing how it looks

The options run from smallest to largest change:

  1. Pass classes. Every component except ThemeScript (which renders only into <head>) takes class, and the classes you pass always win over the recipe. The recipe sits in @layer components and your utilities sit in @layer utilities, so the override does not depend on class order and needs no merging library. A class reaches the element it lands on, not that element's children: a Card's, Section's or CtaBand's padding sits on its inner sections, so use <Card padding="none"> or override the custom property (class="[--wk-card-pad:0.5rem]").

    <Button class="w-full px-10">Continue</Button>
  2. Pass attributes. Every other attribute goes to the root element: aria-*, data-*, id, role and event handlers. The exceptions go to the element assistive technology reads:

    • the form controls with a wrapper (Checkbox, Switch, Slider, NativeSelect, Select, Combobox, InputOTP, and Progress): class styles the wrapper, and every other attribute, ref included, goes to the control itself (the <input>, <select>, or the progressbar);
    • Resizable: aria-label and aria-labelledby to the separator (the wrapper is a generic box);
    • Dialog, AlertDialog, Sheet and Drawer: to the <dialog> (the root is a host with no box);
    • Popover, Tooltip and HoverCard: to the popover; DropdownMenu: to the menu;
    • ContextMenu: id to the menu, the rest to the area; CommandDialog: id to the <dialog>, the rest to the Command inside it;
    • Tabs: aria-label and aria-labelledby to the tablist.

    A component overrides one of your attributes only where its own state requires it (a disabled link's role, a pending button's aria-busy, an urgent Alert's role="alert", a night Section's data-theme, an Icon's role and aria-hidden, which follow its label). Otherwise yours wins: role, tabindex, aria-label (over a label prop and its default, such as a Toaster's "Notifications"), aria-labelledby (and an aria-label replaces the component's own label reference), aria-invalid (true, grammar, spelling), aria-valuetext and data-theme. Winning means you own the contract: a Table given role="presentation" is still a tab stop with a label (give it tabindex={-1} too), and a Spinner given role="none" is no longer announced. Event handlers are wrapped, never replaced: where a component has a handler of its own (a Toggle's onclick, a Slider's oninput, an AccordionItem's ontoggle, a menu's onkeydown), its runs first and then yours, so yours sees the new state. A unit test checks every component for this. A value typed in a Slider's exact box arrives through bind:value, not oninput. The variant attributes (data-variant, data-size, data-tone, data-layout, …) are always set from the props.

    bind:ref gives the element on Button, Link, Input, Textarea, Checkbox, Switch, NativeSelect, Select, Combobox, InputOTP, DatePicker, Slider and Toggle; for anything else, use bind:this on a wrapper or an id.

  3. Rebrand with tokens. Each colour role (engine, canvas, ink, …) and shadow reads a day/night pair. Override the pair once on :root, after the import, and every theme state follows: pinned, system, and islands.

    :root { --wk-day-engine: #2f5d50; --wk-night-engine: #9fd3c1; }

    Shadows work the same way per colour stop (--wk-day-shadow-paper-1, -2, …); their geometry is fixed, so shadow-paper shadow-ink/20 and shadow-paper/50 still work.

    Do not override --color-engine itself; the theme blocks would undo it in some states. Tokens that do not change with the theme (fonts, radii, measures, the pigment-* colours) are ordinary Tailwind theme variables, so an @theme { … } block overrides them. Pigments are prefixed pigment-, so Tailwind's own palette (blue-500, amber-300, …) keeps its meaning.

  4. Style the hooks. Variants are data attributes (data-variant, data-size), so Tailwind's data-[variant=ghost]: works from outside the component.

  5. Read the tokens from code. Python or JavaScript can read @pyaella/workshop/tokens.json, the same file the CSS is generated from.

Forms

Wrap a control in a Field and it is wired for you: the label's for, the control's id, aria-describedby (description, then error), aria-invalid, required and disabled. The error is spoken as an error and appears in a polite live region. value, checked, indeterminate and pressed are bindable.

<Field label="Service name" description="Lower case." error={nameError} required>
  <Input bind:value={name} />
</Field>

Set a control's id as <Field id="...">, or on the control itself (the label follows it once the page is interactive; on a page with no JavaScript, use the Field's). Checkbox and Switch take their name as label="…" or as children, and RadioGroup as legend; they are not wrapped in a Field; their descriptions sit outside the <label>, so they describe the control rather than become part of its name. Give a RadioGroup a name inside a <form>. A NativeSelect with no value and no placeholder takes its first enabled option, as a native select does.

A form reset returns every control to the value the page was drawn with (or mounted with, for a form the page adds later), as it does with no JavaScript, and its bound value follows: text, checks, choices, selects, sliders, codes, dates and the calendars alike. A value the reader chose before the page was live is kept, and a reset still returns to the drawn one. (Svelte removes the server's value and checked attributes at hydration, so each control sets that default again.)

The same idea has the same name across the controls, and each also takes its sibling's: Select and Combobox take options as well as items, NativeSelect and RadioGroup take items as well as options, ToggleGroup takes legend as well as label, and both groups take labelHidden.

SiteHeader takes homeHref (a base path) for the home link and the Wordmark, actions that always stay in the bar, and menuActions that move into the menu on narrow screens (rendered twice, one copy hidden: links and buttons only, no ids or stateful content).

Artwork

Twenty-nine Workshop illustrations: 5 heroes, 11 architecture cards and 13 line drawings, generated for Pyaella, with commercial use approved by the owner. Import each from its own module, so the build carries only the images a page uses:

<script>
  import { Artwork, ArchitectureCard } from "@pyaella/workshop";
  import { artHeroWorkshop } from "@pyaella/workshop/art/heroes-workshop";
  import { artCardDatabase } from "@pyaella/workshop/art/cards-database";
</script>

<Artwork art={artHeroWorkshop} priority />
<ArchitectureCard art={artCardDatabase} href="/architecture/database" />

@pyaella/workshop/art exports all 29 at once (for a gallery), and then every image is in the build: a bundler emits an imported image before it tree-shakes. The metadata alone (titles, alt text, sizes, no images) is @pyaella/workshop/art/catalog.json. Art keeps its printed colours in the evening theme and in forced colours, each family on its own paper mat.

The art needs a bundler that imports images (Vite does). The 13 line drawings are small enough that it inlines them as data: URIs, so a Content-Security-Policy needs img-src 'self' data:. Each image ships at one size; responsive variants are planned.

Journal

An article page:

<ArticleLayout title={post.title} lede={post.summary} headings={post.headings} spy>
  {#snippet byline()}<Byline authors={post.authors} date={post.date} readingTime={readingMinutes(post.html)} />{/snippet}
  {@html post.html}
  {#snippet footer()}<TagList tags={post.tags} /><Footnotes notes={post.notes} />{/snippet}
</ArticleLayout>
  • The body is Prose. Rendered Markdown is styled as it is, GFM footnotes included. Inside it, <Figure width="wide"> (or class wk-wide on any element, for Markdown) breaks out past the reading measure, and width="full" (wk-full) spans the article's column.
  • The table of contents comes from headings ({ id, text, level }, as a Markdown pipeline reports them; the headings in the body need those ids). It lists the two levels under the title (h2 and h3 for an h1 title). On wide screens it is a sticky column beside the body; on narrow ones a native "On this page" disclosure, so it works with no JavaScript. spy marks the section being read once the page is interactive.
  • Dates (Byline, PostCard) are <time datetime> elements printed in locale (default en-US) and in UTC, so the server and every browser print the same day. Pass ISO 8601: a date-only string ("2026-11-21") is that calendar day, and a timestamp with no zone is read as UTC. Anything else ("November 21, 2026") is not a date and is left out.
  • CodeBlock shows code as text, or the markup of your highlighter (Shiki, Prism) passed as html; it ships no highlighter. Copy copies code. The copy button appears once the page is interactive, so a page with no JavaScript shows no dead button.
  • Pagination is links: href builds each URL, either a function of the page number or a template string ("/journal/page/{page}", the form data and codegen can carry). Previous and next carry rel, and the bar keeps a constant width as the reader pages through.
  • Footnotes: <FootnoteRef id="x" n={1} /> in the text and <Footnotes notes={[{ id: "x", text: "…" }]} /> at the end. With two articles on one page, give each a prefix. A second reference to one note takes occurrence={2}, whose id is fnref-<id>-2 as in GFM, so do not give a note an id that ends in -<number>.
  • PostCard is one link (the title, stretched over the card). Its authors and tags are text, so nothing clickable sits inside the link area.

Overlays

Dialog, AlertDialog, Sheet and Drawer are the browser's own <dialog>, opened by an invoker button, so they work with no JavaScript: they open as a modal, move focus in, keep Tab inside, close on Escape, sit above everything and return focus to the trigger.

<Dialog title="Rename service" description="Names are lower case.">
  {#snippet trigger(attrs)}<Button {...attrs}>Rename</Button>{/snippet}
  <Field label="Service name"><Input bind:value={name} /></Field>
  {#snippet footer(close)}
    <Button variant="secondary" {...close}>Cancel</Button>
    <Button {...close} onclick={save}>Save</Button>
  {/snippet}
</Dialog>
  • Opening and closing. The trigger snippet receives commandfor, command="show-modal" and aria-haspopup, to spread onto a button; any button with the same attributes, anywhere on the page, opens it (give the dialog an id). The footer snippet receives the close attributes. A Dialog, Sheet or Drawer also closes on a click on the backdrop (dismissible={false} turns that off for unsaved work) and with its corner button (closeButton, closeLabel).
  • Naming. A title is shown and names it; without one, label (or an aria-label) names it unseen.
  • AlertDialog asks for a decision: no backdrop dismissal and no corner button. The first button given the footer's close attributes takes the focus on opening (they carry autofocus), even when the body has a link, so put the safe choice first. Escape cancels.
  • open is bindable once the page is interactive, and follows the dialog however it closed. onclose and the other dialog events reach the <dialog>. A page rendered on the server starts with it closed.
  • Focus returns to what opened it. Opened from inside a popover or menu (which opening a modal closes), it returns to the button that opens that popover. A closed modal stays hidden whatever display your class sets.
  • Layers. Escape closes one layer at a time, a tooltip or hover card included. A click on the backdrop is outside every layer, so it closes a popover open in the dialog and the dialog together (the platform's light dismiss); use dismissible={false} where that would lose work.
  • Sheet docks to an edge (side: right, left, top, bottom, or start and end, which follow the writing direction: use start for a navigation Sheet, so it opens from the Sidebar's edge on a right-to-left page); Drawer rises from the bottom, with a handle that is decoration (it does not drag).
  • Browsers. Invoker commands need Chrome 135, Firefox 144 or Safari 26.2. On older browsers the dialogs open once the page is interactive (a small listener stands in), but not on a page with no JavaScript.
  • The scroll lock is CSS only: while a modal is open, the page does not scroll, and a modal opened from a scrolled page stays in view without moving it. With classic (non-overlay) scrollbars, as on Windows, the page shifts by the scrollbar's width while it is open.
  • Where a dialog lives. Keep a Dialog out of anything hidden, such as SiteHeader's menuActions (rendered twice, one copy hidden) or a closed disclosure: a modal opened inside display: none is invisible but still makes the page inert. Render the Dialog elsewhere and put only a trigger button, with its attributes, in the menu.
  • Forms. <form method="dialog"> inside the body closes the dialog with the submitter's value. The footer sits outside the body, so a submit button there needs the form's id (<Button type="submit" form="rename-form">).
  • A long body scrolls inside the dialog, so the title, the footer and the close button stay in view; it becomes a tab stop while it overflows, so a keyboard can scroll it.
  • A dialog the reader opens before the page has hydrated stays open when it does.

Popovers, tooltips and toasts

Popover, Tooltip and HoverCard are the browser's own popover, placed next to their trigger by CSS anchor positioning: no anchor names, no inline styles, and they stay on screen: they flip to the other side when there is no room on theirs, and an overlay too wide for its align near an edge is centred on its trigger and slid in.

<Popover title="Health filter">
  {#snippet trigger(attrs)}<Button variant="secondary" {...attrs}>Filter</Button>{/snippet}
  <Checkbox label="Healthy" />
  {#snippet footer(close)}<Button size="sm" {...close}>Close</Button>{/snippet}
</Popover>

<Tooltip content="Checks the contract without compiling.">
  {#snippet trigger(attrs)}<Button aria-label="Validation information" {...attrs}>?</Button>{/snippet}
</Tooltip>
  • Popover opens with no JavaScript: the trigger snippet receives popovertarget (not a Dialog's commandfor: popovertarget needs no JavaScript in many more browsers), and the footer snippet the attributes that hide it. A click outside or Escape closes it, focus returns to the trigger, and Tab from the trigger moves into it. A title (shown), a label or an aria-label makes it a named, non-modal dialog. side (top, right, bottom, left) and align (start, center, end) place it; start follows the writing direction. open is bindable.
  • A class you pass never shows a closed popover, even one that sets display.
  • Tooltip is the trigger's accessible description (aria-describedby, given to the trigger snippet), never its name: an icon-only button still needs its own aria-label. Its text is content (text works too). It shows on hover after delay (400 ms) and at once on keyboard focus, the pointer can move onto it, and Escape hides it (only it: a Dialog it sits in stays open). Text only.
  • HoverCard previews what a link leads to, on hover (openDelay, or delay as Tooltip calls it; closeDelay) and keyboard focus; Tab from the trigger moves into it. Its content also describes the trigger. Keep it supplementary: the link must work without it. Inside running text give it phrasing content (text, <strong>, <a>, <span>): a <div> or <p> would end the paragraph.
  • Hover takes JavaScript. Tooltips and hover cards show only once the page is interactive (the descriptions are there without it). Touch is ignored: a tap is a click.
  • Placement needs CSS anchor positioning (tested in Chrome 156, Firefox 157 and Safari 27.2). Elsewhere, or when a bound popover is opened with no trigger, it opens centred on the screen. Alignment follows the page's direction, so a right-to-left page (dir="rtl" on <html>) is right in every engine; a right-to-left part of a left-to-right page aligns as left-to-right. Firefox places an overlay as if a transform on its trigger's ancestors were not there (a trigger inside a translated or centred-by-transform box gets its overlay off by the shift): position such a box with layout (flex, grid, margins) instead.
  • Taller than the room. An overlay that fits on neither side of its trigger at its natural size is capped to the larger side (or, beside its trigger, to the whole column), centred on the trigger, and scrolls; it never runs off the screen. An overlay placed beside its trigger (a submenu, side="right" or "left") that is too wide for either side, as on a phone, opens over the trigger instead. A menu (24rem) and a Combobox's list (20rem) keep their own caps. Set yours with --wk-anchored-max, from a utility such as class="[--wk-anchored-max:16rem]" (which a strict style-src allows) or your own CSS, on a Popover, Tooltip, HoverCard or DropdownMenu; a Combobox's, ContextMenu's and Menubar's class goes on their wrapper, so set it in your CSS on .wk-combobox__list or .wk-menu instead; a max-height of your own is overridden while the platform places the overlay. Once live, an overlay that had to be capped is held where it fits, and placed afresh when its size changes (content shown after it opened, a trigger the page moved). Once the page is live, a tall Popover with nothing to focus in it makes its body a tab stop, so the keyboard can scroll it.
  • toast(message, options) raises a toast; toast.dismiss(id) removes one (an id given as a number finds the toast raised with it) and toast.dismiss() all. Options: description, tone (neutral, success, warning, danger), duration in ms (6000; Infinity stays), action ({ label, onclick }, which also dismisses it; a toast with an action stays until dismissed unless you give it a duration, so a keyboard can reach it), and id: raising a toast with an id already shown replaces it instead of stacking a duplicate. Place one <Toaster /> per page (position, limit, label, dismissLabel, severityLabels); if there are two, the first to mount shows the toasts and the other stays empty.
  • Toasts are announced politely, each has a dismiss button (dismissing from the keyboard moves focus to the next toast, or back where it came from), and their timers pause while the pointer or focus is on them, while the tab is hidden and while a modal is open. Everything outside an open modal is inert, toasts included, so raise feedback inside a dialog with an Alert, and put errors that must persist in the page, not only in a toast.
  • toast() does nothing on the server, so a toast raised while rendering one request never reaches another: raise toasts from event handlers and effects.

Disclosure and navigation

<Accordion bind:value>
  <AccordionItem value="requirements" summary="Contract requirements">…</AccordionItem>
  <AccordionItem value="governance" summary="Governance policies">…</AccordionItem>
</Accordion>

<Tabs label="Inspector views" items={[{ value: "schema", label: "Schema" }, { value: "policy", label: "Policy" }]} bind:value={tab}>
  {#snippet panel(item)}<SchemaView kind={item.value} />{/snippet}
</Tabs>
  • Collapsible and AccordionItem are native <details>, labelled by summary (title works too, as on every other titled component): they open from a click or the keyboard with no JavaScript, closed content is not a tab stop, and one the reader opens before the page hydrates stays open. An item nested in another item's body is a disclosure of its own, not part of the outer Accordion. Accordion defaults to type="single", which gives its items one shared name, so the browser keeps one open (tested in Chrome 156, Firefox 157 and Safari 27.2); "multiple" lets each open on its own. An item's value must be unique within its Accordion: a later item with a value already taken opens and closes on its own, as one with no value does. value is bindable (the open value, or a list for "multiple"). The height eases open in Chromium; elsewhere it opens at once. The summary is a button to assistive technology, so a heading inside it is not announced as one.
  • Tabs follows the tabs pattern: one tab stop, arrow keys (Up and Down when orientation="vertical"), Home and End, disabled tabs skipped, activation="automatic" or "manual". Name it with label, aria-label or aria-labelledby (each goes to the tablist). The panel snippet is given your item as you passed it, extra fields included. Values must be unique (a repeated value's tab is disabled), and a bound value follows the tab shown, so an unknown or removed value becomes the first enabled tab's. Every panel is in the page: inactive ones are hidden="until-found", so find-in-page reveals them and selects their tab (a disabled tab's panel is plainly hidden), and aria-hidden, so assistive technology meets only the selected one. Switching tabs takes JavaScript: on a page rendered with csr = false use an Accordion (find-in-page can still reveal a panel there, but it stays hidden from assistive technology).
  • NavigationMenu is links, never menu roles. A top-level item is a link, a plain label (no href), or a section ({ label, items }) whose button opens a popover of links, each with an optional description (a link with no href is left out), anchored under it (with no JavaScript, as Popover does). currentPath marks the current link and its section. The list wraps on narrow screens; for a site menu that collapses, use SiteHeader.
  • Sidebar takes sections of { title?, items }, where each item is a { label, href, icon?, badge? } link (icon is one path or a list, as Icon takes; an item with no href, and a section left with none, are left out), and marks the current one by currentPath. Once the page is interactive a button collapses it to a rail (collapsed is bindable; persist="<key>" remembers it in this browser, read after the page loads, so pass collapsed from a cookie if the first paint must match). A collapsed link keeps its label as its name and shows it beside the rail on hover and keyboard focus (Escape hides it). The collapse button comes first, as it is drawn at the top. Two Sidebars sharing a persist key do not follow each other. On narrow screens, put the same Sidebar in a Sheet (side="start"). The header and footer snippets are given { collapsed }, so what they hold can fit the 4rem rail.
  • ScrollArea is a named region and a tab stop (a label or aria-label is required: without a name it is neither), with a thin scrollbar; give it a height with class (max-h-72). Scrolling past its end scrolls the page.

Menus and command

<DropdownMenu
  items={[
    { label: "Duplicate", shortcut: ["mod", "D"], onselect: duplicate },
    { label: "Share", items: [{ label: "Copy link" }, { label: "Email" }] },
    { type: "separator" },
    { type: "checkbox", label: "Show hidden", checked: hidden, onselect: (d) => (hidden = d.checked) },
    { type: "radio", label: "Sort by", value: sort, onselect: (d) => (sort = d.value), items: [{ label: "Name", value: "name" }, { label: "Date", value: "date" }] },
    { label: "Delete", tone: "danger", onselect: remove },
  ]}
>
  {#snippet trigger(attrs)}<Button variant="secondary" {...attrs}>Actions</Button>{/snippet}
</DropdownMenu>

<CommandDialog hotkey={["mod", "k"]} groups={[{ heading: "Contract", items: [{ label: "Compile contract", onselect: compile }] }]} />
  • Items (DropdownMenu, ContextMenu, Menubar) are data: an action (label, optional value, icon, shortcut, tone: "danger"), a link (href), a checkbox (checked), a radio group (value and its options in items), a group (a heading over its items), a separator, or a submenu (an item with items). Choosing one calls the item's own onselect, then the menu's, with { item, value, checked?, group? }. A checkbox or radio option leaves the menu open and reports its new state: update your data to show it. An action or a link closes the menu and puts focus back where it was.
  • The keys are the menu pattern's once the page is interactive: Enter, Space or Down on the button opens a menu on its first item, Up on its last; arrows move and wrap, Home and End, typing the start of a label jumps to it (spaces included: "show h"), Right and Left open and close a submenu (mirrored on a right-to-left page), Escape closes one level, and Tab closes the menu and moves on. A disabled item is focusable, so the reader learns it exists, and does nothing. A shortcut is shown and given to assistive technology as aria-keyshortcuts, but the menu does not bind it: bind it yourself, and show only shortcuts that work.
  • A menu is named by its button, or by label (or an aria-label) when that is not enough.
  • Before hydration, and on a page rendered with csr = false, a DropdownMenu's button still opens its popover and the items are ordinary buttons and links in Tab order: links work, actions wait for JavaScript. Nothing promises a menu until then (no aria-haspopup, no menu roles), and a checkbox's or radio's state is shown but reaches assistive technology only once live (aria-checked).
  • ContextMenu wraps an area; a right-click opens the menu at the pointer, and the Menu key or Shift+F10 opens it beside the focused element. Shift with a right-click still gives the browser's own menu. It needs JavaScript and nothing reveals it on a touch screen or to a keyboard user who does not know to ask, so always offer the same actions somewhere visible, such as a "More actions" DropdownMenu with the same items. Give it a label: it has no button to name it. Its id is the menu's (as a DropdownMenu's is); class and every other attribute go on the area. Inside a transformed element (an open Dialog, Sheet or Drawer included) it still opens at the pointer.
  • Menubar takes menus of { label, items } (a menu with no items is left out). It is one tab stop: Left and Right move along the bar (from inside an open menu, to the next menu, open), Down opens a menu, and with one open, hovering another opens it. It is for an application's commands; for a site's destinations use NavigationMenu.
  • Command is a search over items and groups of { heading?, items }, each { label, value?, keywords?, shortcut?, icon?, disabled?, href?, onselect? }. Focus stays in the search: Up and Down move the highlighted command, Enter runs it, Escape clears the search. It matches every typed word, ignoring case and accents, against the label and keywords, and keeps your order (pass filter to match differently). The first match is highlighted, so Enter runs what is shown, and nothing when nothing matches. query is bindable, and the number of matches is announced. Before hydration the search is disabled (its links still work).
  • CommandDialog puts a Command in a modal Dialog: it opens from its trigger, open, or hotkey anywhere on the page (spelled as Kbd spells keys: ["mod", "k"] is Command-K on Apple platforms and Control-K elsewhere, ["shift", "esc"], ["ctrl", "space"]; exactly those modifiers, and a held key does not toggle it again), on an empty, focused search; running a command closes it and focus returns. Name it with title (shown) or label.

Selection

Each is a native control first. It works with no JavaScript, submits with its form under name, and the browser's own keyboard and assistive-technology behaviour comes with it; the page adds the rest once interactive. Select, Combobox and InputOTP take Field wiring as Input does. ToggleGroup carries its own legend, as RadioGroup does, and a ToggleGroup with no items is left out.

<Field label="Region">
  <Select name="region" bind:value={region} items={[{ value: "eu", label: "Europe", description: "Frankfurt and Dublin" }, { value: "us", label: "United States" }]} />
</Field>
<Field label="City"><Combobox name="city" bind:value={city} items={cities} /></Field>
<ToggleGroup label="Alignment" name="align" bind:value={align} items={[{ value: "left", label: "Left" }, { value: "center", label: "Center" }]} />
<Field label="Verification code"><InputOTP name="code" groups={[3, 3]} oncomplete={verify} /></Field>
  • Select is the platform's <select>. items are { value, label, description?, icon?, disabled? }, and groups are { label, items } (labelled, after items; an empty group is left out). Where the browser can style a select (appearance: base-select: Chrome and Safari today), the picker is the Workshop's: each item's icon and description, a tick on the chosen one, and the chosen item (icon, no description) in the closed control. Elsewhere (Firefox), the browser's own picker shows each item as text ("Europe — Frankfurt and Dublin"), and the closed control looks the same. A placeholder is a disabled first item, chosen while the value is empty; with no placeholder, an empty value takes the first enabled item (as NativeSelect), so the select is never blank. A value the list cannot show is kept, not replaced. For the operating system's picker everywhere (the wheel on a phone), use NativeSelect.
  • Combobox is a text field that suggests: the text is the value, so free text is a fine answer. items are { value, label?, description?, keywords?, disabled? }, where value is the text it fills in. Before the page is interactive it is an <input list> with a <datalist> (the browser suggests). Once live it is the combobox pattern: typing filters (every word, ignoring case and accents, as Command matches; pass filter to match differently), Down opens the list and moves (Alt+Down only opens it), Enter fills in the highlighted suggestion, Escape closes the list and then clears the text. Nothing is highlighted until the reader moves, so Enter submits what was typed. While an input method is composing, its keys are its own. onselect gets { item, value }, and empty is shown when nothing matches (by default the list just closes). For a choice that must be one of the list, use Select. items may be your own type (ComboboxItem plus fields of your own), and onselect hands your item back typed. On a right-to-left part of a left-to-right page, Firefox places the list off the field (it is correct when the whole page is right to left).
  • ToggleGroup is joined toggles: type="single" (native radios, so the arrow keys move the choice, and once chosen one always is) or "multiple" (native checkboxes). value is a string or a list. required applies to single (a set of checkboxes has no native "at least one"). Name the group with label (hidden unless labelVisible); an item with iconOnly shows only its icon and keeps its label as its name. Safari shows no focus ring after the arrow keys move a radio's focus (WK-G24); the focused toggle is then the chosen one, drawn as chosen.
  • InputOTP is a one-time code (its boxes shrink to fit a narrow column): one input (autocomplete="one-time-code"), so pasting a whole code, the phone's SMS autofill and form submission are the browser's own. length is 4 to 8 (6), groups splits the boxes ([3, 3]), mode is "numeric" (the default) or "alphanumeric". Full-width and Arabic-Indic digits count as digits; anything else typed or pasted is dropped, after the paste is read whole ("123-456" keeps every digit), and a pasted whole code replaces what was there. Before the page is interactive it is a plain code field; once live, boxes are drawn over it in exactly its place (nothing moves), with the next box to fill marked. Typing goes on the end; select all, then type or paste, replaces the code. oncomplete runs once each time the reader completes a code, including one completed before the page was interactive (not for a value the app sets). A code reads left to right on every page.
  • Chosen before hydration: a value the reader chose or typed before the page was interactive is kept, not reset by hydration.

Dates

A date is an ISO day string ("2026-11-24") and a month is "2026-11", never a Date: a Date is an instant, and the day it falls on depends on the time zone reading it. An impossible or malformed value, min or max is ignored, never shown. The calendars are Gregorian in every locale (a locale whose own calendar is another, such as fa-IR, keeps its language and digits).

<Calendar name="due" bind:value={due} min="2026-11-01" unavailable={(d) => holidays.has(d)} />
<RangeCalendar startName="from" endName="to" bind:value={audit} onvaluechange={load} label="Audit window" />
<Field label="Release date"><DatePicker name="release" bind:value={release} min="2026-11-01" /></Field>
  • Calendar is the date grid: one tab stop, on the chosen day. The arrow keys move a day or a week (Left and Right swap on a right-to-left page), Home and End go to the week's ends, Page Up and Page Down a month, and with Shift a year; Enter, Space or a click chooses. value and month are bindable, and onvaluechange runs when the reader chooses. Given both, month is the month shown; a value the app sets later shows its own month. Days before min, after max or for which unavailable(date) is true can be reached but not chosen, and the keyboard never leaves min..max; a value on such a day is treated as none. A chosen day's name ends ", selected" (selectedLabel translates it, as previousLabel and nextLabel do the month buttons). Labels are in locale (default "en-US", so the server and the browser agree), and the week starts on weekStart (0 = Sunday, the default; 1 for Monday). Today is the reader's own day, so it is marked (underlined) only once the page is live; with neither value nor month the browser shows the reader's month. With name, a hidden input submits the value. The server draws the month, but choosing needs JavaScript: a form that must work without it uses DatePicker. Name it with label, or it is named by its month; in a Field, the Field's label and the month name it and its description describes it (a grid is not a labelable control, so the label's for does not reach it). Every month takes six weeks' height, so paging never moves what is below. An unavailable that throws rules nothing out.
  • RangeCalendar chooses a start and an end with the same grid. The first pick sets the start and previews the days to the pointer or the focused day; the second sets the end (one before the start swaps them); Escape forgets a start. A range is inclusive and never crosses a day that cannot be chosen: a second pick across one starts a new range there. value is { start, end } or null; a malformed, reversed or out-of-bounds one, or one across an unavailable day, is treated as none. onvaluechange runs when a range completes, and startName/endName submit it as two inputs (empty while a new range is half chosen, as the grid shows). With unavailable, a range wider than ten years is treated as none rather than walked a day at a time.
  • DatePicker is the platform's <input type="date">: typing, the browser's own picker, the reader's locale, min/max validation and form submission all work with no JavaScript, and a date typed before the page was interactive is kept. A form reset returns it to its first value, and the bound value follows. The browser writes the date in the reader's locale, so there is no format option. Field wiring as Input.

Data table

DataTable is a Table that sorts, searches and pages. It has two modes.

<!-- Its own rows: everything happens in the browser. -->
<DataTable caption="Services" {columns} rows={services} pageSize={20} bind:sort bind:query />

<!-- One page of the server's, every state at its own address (works with no JavaScript). -->
<DataTable caption="Services" {columns} rows={data.page} rowCount={data.total} pageSize={20} {...data.state}
  href={(s) => `/services?sort=${s.sort ?? ""}&dir=${s.direction}&q=${encodeURIComponent(s.query)}&page=${s.page}`} />
  • Columns are { key, label, align?, sortable?, filterable?, sortValue?, compare?, format? }. format(value, row) gives the cell's text (shown and searched); cell renders anything richer, as in Table; rowHeader names the column whose cells name their rows.
  • Its own rows (rows alone): it sorts, searches and pages in the browser. sort, direction ("ascending" or "descending"), query and page are bindable, and the server draws the same state, so a page that keeps them in its URL renders it there too. Changing them needs JavaScript: before it, a search typed is kept and applied once the page is live, but the sort buttons do nothing, and Enter in the search does nothing (inside your form, it submits yours). A table that must work with no JavaScript uses the server's mode with href.
  • The server's rows (rows is one page, rowCount the whole set's size; any rowCount means this mode): it sorts and searches nothing itself. Without pageSize, a page is as long as the rows given. With href(state), the sortable headers and the pager are links and the search is a GET form whose hidden fields carry the rest of the state, so each state has an address and works with no JavaScript. The search field is named queryParam ("q"); it must be the name your href gives the query. In a SvelteKit app, following one keeps the reader's scroll position and focus (data-sveltekit-reset="false"; pass your own to change it). Without href, they call onstatechange(state) and update the bound state, and the app fetches (from either); the search asks on Enter, not on every key. busy marks the table while it waits. A search typed before the page is live stays in the field until it is submitted.
  • Sorting: a sortable column's header holds the control and its <th> the aria-sort. The first press sorts ascending, the next descending. Numbers, dates and booleans compare as such, and text with Intl.Collator in locale with numeric order ("item 2" before "item 10") and lower case first, so the server and every browser agree. Empty values come last either way, and equal rows keep their order. sortValue(row) or compare(a, b) change the order. A new sort or search goes back to page 1.
  • Search matches every word, ignoring case and accents, in the text of each column that is not filterable: false; filter(row, query) replaces it (a blank search always shows every row). Turn it off with searchable={false}.
  • Status: one polite line below the table gives the sort, the count and the page ("Sorted by Latency, descending. 12 of 40 rows · Page 1 of 2"), because screen readers announce a changed aria-sort unreliably. An empty table shows emptyLabel (or empty), and no matches says so.
  • Keys: rows are keyed by rowKey (a column key or a function; the row's id by default). A duplicate key is made unique, not dropped.
  • The pager is a page's previous and next buttons, which stay focusable at the ends (marked disabled), or with href the Pagination links.
  • Names: the search is a search landmark named by the caption; an aria-label you pass names the table's region.
  • Inside your form: only the address mode's search is a <form> (a GET form, so it works with no JavaScript). The other modes' search is a role="search" box with no name, so a table can sit inside your own form, and once the page is live Enter in it never submits yours (with no JavaScript, Enter in any field submits its form). A table with href cannot sit inside a form (a form in a form is dropped by the HTML parser); place it beside yours.
  • Rows of your type: DataTable is generic, so columns: DataTableColumn<Service>[] and rows: Service[] type-check with your own interface, and cell, filter and rowKey receive it.
  • Every string is a prop with an English default: searchLabel, emptyLabel, noMatchesLabel, countLabel, sortedLabel, previousLabel, nextLabel, pageLabel, pageLinkLabel, pagesLabel (the address mode pager's name).

Workspace

None of these sets a style attribute, so all three work under a strict style-src.

<Chart title="Request latency" unit="ms" labels={times} series={[{ name: "p95", values: p95 }, { name: "p50", values: p50 }]} />
<Chart kind="bar" title="Deploys by day" labels={days} series={[{ name: "Production", values: prod }]} />
p95 this hour <Chart kind="sparkline" title="p95 latency" unit="ms" series={[{ name: "p95", values: p95 }]} />

<Carousel label="Architecture" items={cards} bind:index>
  {#snippet slide(card)}<FeatureCard {...card} />{/snippet}
</Carousel>

<Resizable bind:size min={20} max={80} onresizeend={(s) => saveCookie("split", s)}>
  {#snippet start()}<Editor />{/snippet}
  {#snippet end()}<Inspector />{/snippet}
</Resizable>
  • Chart is drawn by the server and needs no JavaScript.
    • kind is "line", "bar" (grouped series, from zero) or "sparkline" (one series, inline, no axes).
    • labels are the categories. series are { name, values }, one value per label; a value that is not a number is a gap, never a zero.
    • The figure is named by title (with unit). A summary line gives each series' range and last value, and "Show the data" opens the numbers as a table, so the plot itself is hidden from assistive technology.
    • Up to four series are told apart by a dash (lines) or a fill (solid, hatched, outlined, dotted bars) as well as a colour, in the legend too; a fifth takes the first's style again. Every series colour is at least 3:1 against the page, a surface and a panel, in both themes.
    • labels keep their places (a missing one is blank), and no value past the last label is dropped. Right to left, the plot runs from the right with its labels.
    • Numbers use Intl.NumberFormat in locale, or format. A value is written as precisely as it is given (to twelve significant digits), so an error rate of 0.0012 is not rounded to 0. The scale's ticks take as many decimals as their step needs, or tickFormat. summary replaces the whole summary; summaryLabel({ name, low, high, last }) and noDataLabel(name) write each series' sentence in your language, and dataLabel names the table. With no value at all the chart is its title and emptyLabel ("No data."), with no plot or table. height is "sm", "md" or "lg". In forced colours the series are drawn in the system's text colour, told apart by their dashes and fills.
    • The labels are HTML, so they never shrink with the chart; a label longer than its column is cut short (the data table has it whole).
  • Carousel is a track that scrolls and snaps a slide at a time. Touch, a trackpad and the keyboard (the track is focusable) work with no JavaScript; the buttons and the position appear once the page is live (they are kept in place before, so nothing moves). It scrolls only its own track, never the page.
    • Once the page is live, Previous and Next move a slide. They stay focusable at the ends, marked disabled, unless loop.
    • The position ("2 of 5") is a polite status read when a scroll ends, so a swipe moves it too.
    • It never moves by itself.
    • index is bindable (setting it scrolls there), and perView shows 1, 2 or 3 slides.
    • label names it. slidesLabel, previousLabel, nextLabel, positionLabel, roleLabel ("carousel") and slideRoleLabel ("slide") translate the rest. With no items there is no track.
    • Starting past the first slide, Chromium draws it there; other browsers draw the first slide and scroll to it once the page is live.
  • Resizable is two panes and the window splitter between them. direction is "horizontal" (side by side) or "vertical" (stacked); nest them for more panes.
    • The separator takes focus. The arrow keys along its axis move it by step (Left and Right swap on a right-to-left page), Home and End go to min and max, and Enter collapses the first pane and restores it. A pointer drags it.
    • size (the first pane's share, in percent) is bindable, and onresizeend reports a finished change (only when the size changed). A click on the separator focuses it. Keep it in a cookie so your server can draw it.
    • The server draws the nearest 5 %, and the exact size once the page is live, so keep sizes to steps of 5 (the default step) to avoid a small jump. Moving it needs JavaScript.
    • A pane scrolls, so it clips what overflows it, focus rings included: give its content a little padding.

Agent and collaboration

The pieces of a conversation with people and agents. Every text prop is shown as text, never parsed as HTML (a long hash or path wraps): pass markup as a snippet only if you made it safe. Line breaks are kept in a Bubble's text, a Trace entry's description and detail, and a Questionnaire review's answers; elsewhere (names, titles, errors) they are spaces. None sets a style attribute (Message's avatarSrc draws the photo through Avatar, once the page is live); all of them read with no JavaScript.

<ol class="flex flex-col gap-4">
  <Marker as="li" variant="ruled" text="Today" />
  <Message as="li" author="Ada" timestamp={sentAt} timeZone={reader.zone} text={draft} align="end" />
  <Message as="li" author="Workshop assistant" badge="Agent" timestamp={at} text={reply}>
    {#snippet actions()}<Button size="sm" variant="ghost" aria-label="Copy the reply">Copy</Button>{/snippet}
  </Message>
  <Marker as="li" busy live text="Thinking…" />
</ol>

<Attachment name="review.pdf" size={1_500_000} state="uploading" progress={64} onremove={cancel} />
<Trace title="Checked the contract" entries={events} duration={40} />
  • Message shows author, and badge names an automated author in words ("Agent"), so who spoke is never told by colour or side alone.

    • timestamp (a Date, epoch milliseconds or an ISO 8601 string) is a <time datetime> printed in timeZone and locale. The zone is UTC unless you pass one, so the server and the browser print the same text: pass the reader's zone (from their profile or a cookie) for local times. A time printed in UTC says so ("10:42 AM UTC"), unless your timeFormat names the zone itself. timeFormat takes Intl.DateTimeFormat options (the short time by default). A locale the runtime rejects or lacks is en-US in the same zone (as everywhere in the package, not the runtime's own default); a zone it rejects, UTC. Pass a locale both your server and your readers' browsers support, or they print different words. A date with no time ("2026-11-27") is printed as that date.
    • The body is text, in a Bubble (primary when align="end", else neutral; variant changes it), or your children. actions are yours: name each one.
    • continued is a later message in one author's run: its header is kept for assistive technology only and its avatar's place stays empty. The avatar is decoration (the header names the author): avatarSrc gives it a photo, avatar={false} drops it, a snippet replaces it.
    • as="li" (or "article") puts it in your list. It is a layout, not a live region: announcing new messages is MessageScroller's.
  • Bubble is one turn on its own (only text keeps its line breaks; your markup's own whitespace is not text): align ("start", "end"), variant ("neutral", "primary", "outline", "danger"), at most 65 characters and 80 % of its row wide. It names no speaker; put it in a Message. reactions are read-only, { symbol, label, count? }, each read by its label and count (reactionsLabel names the list); one with no label is dropped. For reactions people can press, render your own buttons in the message's actions.

  • Marker is a note or divider between turns: variant "plain", "ruled" (rules either side, its text still read: it is not a separator) or "border", with an icon or a busy ring. live makes it a polite status: use it only for a real update ("Thinking…"), never for history, or a reader hears the whole transcript on load. Keep a live Marker mounted and change its text: not every screen reader announces a status that arrives already holding its text. As a list item (as="li") the status is its text, so the item stays in its list.

  • Attachment is a file's name, format (its extension, or format, which is also read aloud when the name does not say it; a name with no extension shows "FILE" unless you pass format, in your language), size (size in bytes, in SI units in locale) and state: "queued", "uploading", "processing", "error" or "done", always in words (stateLabels translates them).

    • While uploading, a native <progress> shows progress. Without it (the size is unknown) a band slides along the track, or stripes run its length under reduced motion; never a bar that reads as full or empty. In forced colours it is drawn in the system's colours.
    • A change of state is announced politely with the file's name and, for an error, error. The component does not announce the percentage (some screen readers read a progress bar's changes themselves).
    • The name links to href only for an http:, https:, blob: or relative address; anything else (javascript:, data:) shows it as text.
    • Remove (onremove) and Retry (onretry, on an error) appear once the page is live, each named with the file ("Remove review.pdf"); removeLabel and retryLabel translate them. Retry takes itself away, so it moves the focus to Remove (or the file's name) first. Your actions always render, so a page with no JavaScript can offer a form's button.
    • When a Remove takes the row away, move focus somewhere sensible (the list, the next file): the component cannot, since the app removes it.
    • File policy (types, sizes) and scanning are your server's: the component reads no file.
  • Trace is the recorded events of a run: a <details>, closed unless open (bindable), that opens with no JavaScript.

    • Its summary is title, the run's state in words and, if you give it, duration: the entries' durations are never summed, since steps may overlap.
    • entries are { id?, title, status?, description?, detail?, duration?, source? }. status is "pending", "running", "success", "warning", "error", "skipped" or "cancelled", each an icon and a word (statusLabels); an entry with no status (or an unknown one) claims none. source is where it came from ("compiler", a tool's name); detail is preformatted text (output, a payload) in a closed disclosure. Each is named "Show details" and its entry's title (detailLabel; a function given the title returns the whole name).
    • The state is state, or the entries': any running, else any error, else any warning, else any pending, else any cancelled, else success. With no entries it says emptyLabel ("Nothing recorded yet.") and claims no state.
    • A later entry with the same id updates that entry in place, so you can append events as they arrive (a step's start, then its outcome) and a duplicate event is harmless. Give entries ids whenever the list can change other than at its end: without one, an entry is known by its title and which occurrence of it it is.
    • Durations read in the largest unit they reach: "12 ms", "1.2 sec", "1.5 min".
    • It shows only what you give it: redact secrets and tokens before they reach it, and pass recorded actions and outcomes, never a model's private reasoning. It has no live region: a running trace updates silently.
  • MessageScroller is a transcript that keeps the reader's place. Give it a height (a class such as h-96, or a flex parent). It draws its own frame (a border and rounded corners), so give it a height, not a border: a border of yours draws a frame inside a frame.

    <MessageScroller label="Release thread" class="h-96" {messages} hasEarlier={more} onLoadEarlier={loadOlder} earlierHref="?before={oldest}" />
    • It opens at the latest message, with no JavaScript too: the scroller is reversed, so its scroll origin is the latest message while the content keeps its reading order.
    • dayDividers puts a ruled Marker naming the day before each day's first message, in timeZone (UTC unless given) and locale. Pass a function for your own words: it is given the ISO day and returns the text ((day) => day === today ? "Today" : ""; an empty string keeps the date). It works with your own message snippet too. A message with no timestamp starts no day; a day that comes back (messages out of order) gets another divider.
    • A divider is an item of the transcript's list, so a screen reader counts it ("list, 32 items" for 28 messages) and reads its date as an item.
    • Words that depend on the clock ("Today") must come out the same on the server and in the browser: work out today from a date the server sends, in the same timeZone, not from each side's own clock, or the label can differ when the page hydrates.
    • It follows new messages, and a reply that grows as it streams, only while the reader is at or near the latest (threshold, 48 px by default). With follow={false} it does not move the reader within the threshold, though at the very end the browser keeps the latest message in view. Away from the latest, the reader's place is kept, and Jump to latest shows how many messages arrived since ("Jump to latest, 3 new"; latestLabel, unseenLabel, or a latestLabel function given the count that writes the whole text). It moves the focus to the transcript as it goes. History added above keeps the place too.
    • Each message is drawn inside the scroller's own <li>: a Message or Marker your snippet renders must not take as="li" (a list item in a list item is split by the HTML parser, and the page fails to hydrate).
    • messages are keyed by id, compared as strings (1 and "1" are one message; a repeated id updates that message in place; one with no id is dropped) and drawn by your message snippet, or a `Message