# Blocks Design System: the complete docs > React components, design tokens and CSS for Blocks products. 93 documents, complete and in reading order. Each starts after a header between lines of `=`, with its title, section, page URL and Markdown URL. For one page at a time, start at https://design-system.blocks-ui.com/llms.txt. ================================================================================ title: Installation section: Getting started url: https://design-system.blocks-ui.com/getting-started/installation markdown: https://design-system.blocks-ui.com/getting-started/installation.md ================================================================================ # Installation `@blocks/design-system` is one package: React components from a single import, design tokens as CSS and as typed data, an optional reset and optional Geist fonts. ## Supported versions | Dependency | Version | | --- | --- | | React and React DOM | 19.3 (peer dependencies) | | Next.js, if you use it | 16.4 (tested with 16.4.6) | | Bun | 1.4 (the repository’s package manager; any npm-compatible client installs the package) | ## In a React app Install the package with its peers. Until the first registry release, install the release-candidate tarball, whose SHA-256 is recorded with each release; the file name carries the version. ```sh bun add @blocks/design-system react react-dom # or, for a release candidate: bun add ./blocks-design-system-0.0.0.tgz react react-dom ``` Import the stylesheet once in your root layout, before your own CSS. Add the reset and Geist if you want them; both are optional. ```tsx // app/layout.tsx import '@blocks/design-system/styles.css' import '@blocks/design-system/fonts/geist.css' // optional: Geist and Geist Mono import '@blocks/design-system/reset.css' // optional: global reset ``` Then import components from the package root. This page is a Server Component: it renders a static heading and an interactive Tabs from the same import, and forces a dark theme on its article with `data-ds-theme`. **Example: A first page** (`examples/foundations/first-page.tsx`) ```tsx // The installation guide's first page: a static heading and an interactive // compound from the same import, in a Server Component, with a scoped theme. import { Box, Heading, Tabs, TabsList, TabsPanel, TabsTab } from '@blocks/design-system' export default function FirstPage() { return ( Station Summary History Current conditions Past observations ) } ``` From a Server Component, import compound parts by name (`TabsList`); in a `'use client'` file you can also write `Tabs.List`. See [Composition](https://design-system.blocks-ui.com/foundations/composition.md). ## CSS only Apps that only want the tokens import the smaller token stylesheet and read the `--ds-*` custom properties from their own CSS. No React is involved. ```css @import '@blocks/design-system/tokens.css'; .card { padding: var(--ds-space-lg); color: var(--ds-color-text); background: var(--ds-color-bg-subtle); border-radius: var(--ds-border-radius-md); } ``` ## Build-time tokens `@blocks/design-system/tokens` is plain JavaScript for build scripts: token values, `cssVarName`, and `renderTokensCss` for a stylesheet scoped to your own root. See [Themes](https://design-system.blocks-ui.com/foundations/themes.md). ================================================================================ title: Writing docs pages section: Getting started url: https://design-system.blocks-ui.com/getting-started/writing-docs markdown: https://design-system.blocks-ui.com/getting-started/writing-docs.md ================================================================================ # Writing docs pages Each page is MDX under `apps/docs/app`, listed in `app/nav.ts` in reading order. The sidebar and the previous and next links read that manifest. ## Examples An example is a file under `apps/docs/examples` that default-exports one component. `` renders it live and shows the same file’s source, so the preview and the code cannot drift apart. ```mdx ``` **Example: Release status** (`examples/writing-docs/release-status.tsx`) ```tsx export default function ReleaseStatus() { return (

Release candidate 0.1.0-rc.0 is ready to verify.

) } ``` - Import from `@blocks/design-system`, never from package source paths. - Add `"use client"` when the example uses state, effects or the dot API of a client component. Named parts work from a Server Component. - Keep each file to one idea, with realistic content. ## Agents read the same page Every page is also served as Markdown, listed in `llms.txt` and readable through the docs’ MCP server; see [Using the docs from an agent](https://design-system.blocks-ui.com/agents.md). The Markdown is the page’s own MDX with each component replaced by a fixed form, so: - Give the page a `description` in its metadata, or open it with a paragraph that says what it’s for. `llms.txt` and the HTML `` both use it. - A new MDX component needs a Markdown form in `apps/docs/agents/components.ts`. Without one, the docs build fails rather than leaving it out of the Markdown. - Write `{expressions}` in code, not in prose: they have no Markdown form either. ================================================================================ title: Contributing and releases section: Getting started url: https://design-system.blocks-ui.com/getting-started/releases markdown: https://design-system.blocks-ui.com/getting-started/releases.md ================================================================================ # Contributing and releases ## Working on the package ```sh bun install --frozen-lockfile (cd apps/docs && bunx playwright install chromium firefox webkit) bun run dev # docs at http://localhost:4300, rebuilding the package as it changes ``` Each component family lands as three commits: the implementation with a live example, a Playwright journey, and its reference page. `AGENTS.md` in the repository lists every command. ## Verifying a revision `bun run verify` is the gate for every change that lands: Biome and the token-only CSS rule, typecheck, the package and docs builds, the generated-output, export and reference checks, every docs journey across Chromium, Firefox and WebKit, and `pack:check`, which installs the packed tarball in a Next App Router app and a Bun-bundled app outside the repository and drives both in a browser. ## Packing a release candidate From a clean checkout of the revision you verified: ```sh git status --short # must be empty bun install --frozen-lockfile bun run verify bun run pack # writes .pack/blocks-design-system-.tgz and .pack/pack.json shasum -a 256 .pack/blocks-design-system-*.tgz ``` `.pack/pack.json` records the version, the tarball’s SHA-256, the Git SHA it was packed from (and whether the tree was clean), its file list and the measured footprint. Builds are reproducible: packing the same revision again gives the same digest. Share the tarball with its digest and Git SHA, and install it by path: ```sh bun add ./blocks-design-system-0.0.0.tgz react react-dom ``` ## The docs from the same revision ```sh bun run build # package, then the docs’ production build cd apps/docs && bun run start # http://localhost:4310 ``` Set `DOCS_ORIGIN` to the deployed address when building docs for deployment; the sitemap uses it. ## Publishing Describe the release under `## Unreleased` in the changelog and commit it. Then, from an up-to-date, clean `main`, run `make verify`. `make release` (a patch release), `make release minor` or `make release major` assumes that passed. It bumps the version, packs the release commit and tags it with the tarball’s digest and Git SHA, all locally. `make publish`, logged in to npm, pushes the commit and tag to `main` and publishes that same tarball. If publishing fails after the push, run `make publish` again. Deploying the docs is a separate step. The [changelog](https://github.com/blocks/design-system/blob/main/packages/design-system/CHANGELOG.md) lists what each version contains. ================================================================================ title: Using the docs from an agent section: Agents url: https://design-system.blocks-ui.com/agents markdown: https://design-system.blocks-ui.com/agents.md ================================================================================ # Using the docs from an agent These docs serve the same pages in forms an agent can use directly. Prefer the MCP server when the agent’s client supports it; otherwise give it `llms.txt` or a page’s Markdown URL. They are alternate interfaces to the same content, not separate documentation. ## What to give your agent 1. **The client supports MCP?** Connect the [MCP server](https://design-system.blocks-ui.com/agents/mcp.md) at [https://design-system.blocks-ui.com/mcp](https://design-system.blocks-ui.com/mcp). The agent searches and reads the docs as tools while it works. 2. **No MCP, but the agent can fetch URLs?** Give it [https://design-system.blocks-ui.com/llms.txt](https://design-system.blocks-ui.com/llms.txt), the index of every page, and let it fetch the pages it needs. 3. **Need one exact page?** Give it that page’s URL ending in `.md`, or have it request the page with `Accept: text/markdown`. To tell an agent in one line: ```text Build UI with @blocks/design-system. Read its docs through the MCP server at /mcp, or start at /llms.txt, and check a component's page for its import, examples and props before using it. ``` Replace `` with this site’s address, [https://design-system.blocks-ui.com/](https://design-system.blocks-ui.com/). ## Every interface | To get | Use | | --- | --- | | search and retrieval as tools | the [MCP server](https://design-system.blocks-ui.com/agents/mcp.md) at `/mcp` | | an index of every page | `/llms.txt` | | one page as Markdown | the page’s URL with `Accept: text/markdown`, or the same URL ending in `.md` | | the docs’ structure | `/sitemap.md` | | every page in one file | `/llms-full.txt` | Given only the docs’ address, an agent can find the rest: the homepage’s Markdown, [https://design-system.blocks-ui.com/index.md](https://design-system.blocks-ui.com/index.md), lists every interface above. ## What a component page gives an agent Each component page’s Markdown has the import line, every live example as the source of the file that renders it, and the props table from the package’s generated prop metadata. An agent that reads the page before writing code gets the same API a person sees, including which parts are client components and how they compose. ## In this section - [Markdown and llms.txt](https://design-system.blocks-ui.com/agents/markdown.md): content negotiation, `.md` URLs, `llms.txt`, `llms-full.txt` and the docs sitemap. - [MCP server](https://design-system.blocks-ui.com/agents/mcp.md): connecting a client, the `search_docs` and `get_doc` tools, and `blocks://docs/` resources. ## What the interfaces cover Every agent interface carries the same pages as the sidebar. They don’t include the package’s source, the demo pages or anything private. All of them are generated from the pages’ own MDX and the nav, so a page added to the docs shows up in each of them, and none can say something its HTML page doesn’t. ================================================================================ title: Markdown and llms.txt section: Agents url: https://design-system.blocks-ui.com/agents/markdown markdown: https://design-system.blocks-ui.com/agents/markdown.md ================================================================================ # Markdown and llms.txt Every docs page, and the homepage, has a Markdown version: the same content as the HTML page, without navigation, scripts or styling. Fetch the page you need as Markdown, and use an index to find it: | Use | When | | --- | --- | | a page’s Markdown | you know the page you want | | [`llms.txt`](#llmstxt) | to find pages: every page, with what it’s for | | [the docs sitemap](#the-docs-sitemap) | to see how the docs are organized | | [`llms-full.txt`](#llms-fulltxt) | to load everything at once; it’s large | ## Ask for Markdown Add `.md` to a page’s path, or request its own URL with `Accept: text/markdown`. Both return the same document: ```sh curl /components/select.md curl -H "Accept: text/markdown" /components/select ``` Here `` is this site’s address, [https://design-system.blocks-ui.com/](https://design-system.blocks-ui.com/). The homepage’s Markdown is [https://design-system.blocks-ui.com/index.md](https://design-system.blocks-ui.com/index.md). - **Content type.** Responses are `text/markdown; charset=utf-8`, with a `Link` header naming the page’s canonical URL. - **Browsers still get HTML.** A request gets Markdown only when its `Accept` header names `text/markdown` and doesn’t rate `text/html` higher, so `*/*` and a browser’s usual header get the page. - **Links lead to Markdown.** Links between pages are absolute `.md` URLs, so an agent can follow them without getting HTML. - **Unknown URLs are 404s.** A `.md` URL that isn’t a docs page answers `404` in Markdown. Only pages in the nav can be requested, never files. - **HTML pages point to it.** Each page names its Markdown in its head: ``. ## What’s in a page’s Markdown It’s the page’s own MDX, not a copy: its imports and metadata removed, and each component replaced by a fixed Markdown form. - An `` becomes its title, the path of its file under `apps/docs/examples`, and that file’s source in a fenced block. It’s the same file that renders the live example. - A `` becomes a Markdown table from the package’s `props.json`, with the shared props it also accepts. - The token tables become Markdown tables from `@blocks/design-system/tokens`. A component without a Markdown form fails the docs build, so nothing on a page can silently go missing from its Markdown. No model writes any of it. ## llms.txt [https://design-system.blocks-ui.com/llms.txt](https://design-system.blocks-ui.com/llms.txt) is the index, in the [llms.txt](https://llmstxt.org) format: what the design system is, then every page by docs section, each linked to its Markdown with a sentence on what it’s for, then these agent interfaces. Read it first, then fetch only the pages you need. A page’s sentence is its own description, or its opening paragraph when it has none; the HTML page uses the same one. ## The docs sitemap [https://design-system.blocks-ui.com/sitemap.md](https://design-system.blocks-ui.com/sitemap.md) is the sidebar as a nested Markdown list: each section, then its pages in reading order, linked to their Markdown. `llms.txt` has the same pages with descriptions. ## llms-full.txt [https://design-system.blocks-ui.com/llms-full.txt](https://design-system.blocks-ui.com/llms-full.txt) is every docs page in one file, whole and in reading order. It’s large, so prefer `llms.txt` and single pages unless you want everything. Its first lines say how many documents follow, and nothing is truncated. Each document starts with a header between two lines of 80 `=` signs, with its `title:`, its `section:` in the docs, its page `url:` and its `markdown:` URL, one per line. ## Next - [MCP server](https://design-system.blocks-ui.com/agents/mcp.md): search and read the same pages as tools and resources. - [Using the docs from an agent](https://design-system.blocks-ui.com/agents.md): which interface to give an agent. ================================================================================ title: MCP server section: Agents url: https://design-system.blocks-ui.com/agents/mcp markdown: https://design-system.blocks-ui.com/agents/mcp.md ================================================================================ # MCP server The docs’ MCP server is at [https://design-system.blocks-ui.com/mcp](https://design-system.blocks-ui.com/mcp). It searches and reads these docs: the same pages and the same Markdown the site serves. It’s public, needs no account or key, and never calls a model. ## Connect Add it as a remote HTTP server. Claude Code: ```sh claude mcp add --transport http blocks-design-system https://design-system.blocks-ui.com/mcp ``` Cursor, in `.cursor/mcp.json`: ```json {"mcpServers":{"blocks-design-system":{"url":"https://design-system.blocks-ui.com/mcp"}}} ``` VS Code, in `.vscode/mcp.json`: ```json {"servers":{"blocks-design-system":{"type":"http","url":"https://design-system.blocks-ui.com/mcp"}}} ``` Any other client that supports remote servers takes the same URL. Opening it in a browser answers `405`: it’s an endpoint for MCP clients, not a page. ## Tools The usual workflow is two calls: search with a few distinctive words, then read the best page. | Tool | Takes | Returns | | --- | --- | --- | | `search_docs` | `query`: a few distinctive words, every one of which must match. `limit`: 1 to 20 results, 8 by default. | the best-matching sections, each with its page, heading, canonical URL, `blocks://docs/` URI and a short excerpt | | `get_doc` | `path`: a route like `/components/select`, a docs URL with or without `.md`, or a `blocks://docs/` URI from `search_docs` | the page’s Markdown, with its title, description and canonical URL | Both are read-only. `search_docs` searches each page by section: every word must appear in the page’s title, the section’s heading or its text, and matches in titles and headings rank first. Each result links to its section’s heading on the HTML page. It returns excerpts rather than whole pages. `get_doc` returns exactly what the page’s `.md` URL serves, including each example’s source and the props table. A path that isn’t a docs page, such as a file in the repository or another site’s URL, is a tool error that says how to find pages. Arguments that don’t match a tool’s schema are errors too, never a partial result. ## Resources Every page is also a resource, for clients that attach context rather than call tools: `blocks://docs/{path}`, such as `blocks://docs/components/select` or `blocks://docs/foundations/themes`. Listing resources lists every page with its title and description. Reading one returns its Markdown as `text/markdown`. Use the tools when the agent needs to find something; use a resource when you already know the page you want. ## Protocol compatibility The server speaks MCP’s Streamable HTTP transport, statelessly, to clients on the 2026-07-28 protocol revision and to 2025-era ones. It allows requests from any origin, so browser-based clients can use it too. ## Next - [Markdown and llms.txt](https://design-system.blocks-ui.com/agents/markdown.md): the same pages over plain HTTP. - [Using the docs from an agent](https://design-system.blocks-ui.com/agents.md): which interface to give an agent. ================================================================================ title: Tokens section: Foundations url: https://design-system.blocks-ui.com/foundations/tokens markdown: https://design-system.blocks-ui.com/foundations/tokens.md ================================================================================ # Tokens The design tokens are the single source of the system’s values. They ship three ways: as `--ds-*` custom properties in `tokens.css` (and `styles.css`), as typed data from `@blocks/design-system/tokens`, and as the prop types of the components (`padding="md"`). The tables below are rendered from the package’s own token data. ```ts import { cssVarName, tokens } from '@blocks/design-system/tokens' tokens.space.md // 8 cssVarName('space', 'md') // '--ds-space-md' ``` ## Semantic colors Components read only the semantic tier. Each name points at a Radix Colors step in each theme; dark mode and `data-ds-theme` swap these and nothing else. Steps follow Radix’s roles: 1–2 backgrounds, 3–5 component fills, 6–8 borders and focus, 9–10 solid fills, 11–12 text. **Semantic colors** | Token | Light | Dark | | --- | --- | --- | | `--ds-color-bg` | `slate-1` | `slate-dark-1` | | `--ds-color-bg-subtle` | `slate-2` | `slate-dark-2` | | `--ds-color-surface` | `slate-3` | `slate-dark-3` | | `--ds-color-surface-hover` | `slate-4` | `slate-dark-4` | | `--ds-color-surface-active` | `slate-5` | `slate-dark-5` | | `--ds-color-selected` | `indigo-4` | `indigo-dark-4` | | `--ds-color-border-subtle` | `slate-6` | `slate-dark-6` | | `--ds-color-border` | `slate-7` | `slate-dark-7` | | `--ds-color-border-strong` | `slate-8` | `slate-dark-8` | | `--ds-color-focus-ring` | `indigo-9` | `indigo-dark-9` | | `--ds-color-accent` | `indigo-9` | `indigo-dark-9` | | `--ds-color-accent-hover` | `indigo-10` | `indigo-dark-10` | | `--ds-color-accent-fg` | `#fff` | `#fff` | | `--ds-color-accent-subtle` | `indigo-3` | `indigo-dark-3` | | `--ds-color-accent-text` | `indigo-11` | `indigo-dark-11` | | `--ds-color-danger` | `red-9` | `red-dark-9` | | `--ds-color-danger-hover` | `red-10` | `red-dark-10` | | `--ds-color-danger-fg` | `#fff` | `#fff` | | `--ds-color-danger-subtle` | `red-3` | `red-dark-3` | | `--ds-color-danger-text` | `red-11` | `red-dark-11` | | `--ds-color-warning` | `amber-9` | `amber-dark-9` | | `--ds-color-warning-hover` | `amber-10` | `amber-dark-10` | | `--ds-color-warning-fg` | `slate-12` | `slate-12` | | `--ds-color-warning-subtle` | `amber-3` | `amber-dark-3` | | `--ds-color-warning-text` | `amber-11` | `amber-dark-11` | | `--ds-color-success` | `green-9` | `green-dark-9` | | `--ds-color-success-hover` | `green-10` | `green-dark-10` | | `--ds-color-success-fg` | `#fff` | `#fff` | | `--ds-color-success-subtle` | `green-3` | `green-dark-3` | | `--ds-color-success-text` | `green-11` | `green-dark-11` | | `--ds-color-info` | `blue-9` | `blue-dark-9` | | `--ds-color-info-hover` | `blue-10` | `blue-dark-10` | | `--ds-color-info-fg` | `#fff` | `#fff` | | `--ds-color-info-subtle` | `blue-3` | `blue-dark-3` | | `--ds-color-info-text` | `blue-11` | `blue-dark-11` | | `--ds-color-text-muted` | `slate-11` | `slate-dark-11` | | `--ds-color-text` | `slate-12` | `slate-dark-12` | | `--ds-color-overlay` | `slate-a9` | `slate-a11` | ## Scales Space and font sizes are pixels; everything else carries its unit. Breakpoints are minimum widths: the responsive props and `@custom-media (--ds-md)` apply from that width up. **Space (px)** | Token | Custom property | Value | | --- | --- | --- | | `none` | `--ds-space-none` | `0` | | `xxs` | `--ds-space-xxs` | `1` | | `xs` | `--ds-space-xs` | `2` | | `sm` | `--ds-space-sm` | `4` | | `md` | `--ds-space-md` | `8` | | `lg` | `--ds-space-lg` | `16` | | `xl` | `--ds-space-xl` | `32` | | `xxl` | `--ds-space-xxl` | `64` | | `xxxl` | `--ds-space-xxxl` | `128` | | `xxxxl` | `--ds-space-xxxxl` | `256` | | `xxxxxl` | `--ds-space-xxxxxl` | `512` | **Font sizes (px)** | Token | Custom property | Value | | --- | --- | --- | | `body` | `--ds-font-size-body` | `16` | | `heading` | `--ds-font-size-heading` | `24` | | `code` | `--ds-font-size-code` | `14` | | `xxs` | `--ds-font-size-xxs` | `10` | | `xs` | `--ds-font-size-xs` | `12` | | `sm` | `--ds-font-size-sm` | `14` | | `md` | `--ds-font-size-md` | `16` | | `lg` | `--ds-font-size-lg` | `20` | | `xl` | `--ds-font-size-xl` | `24` | | `xxl` | `--ds-font-size-xxl` | `32` | | `xxxl` | `--ds-font-size-xxxl` | `48` | | `xxxxl` | `--ds-font-size-xxxxl` | `64` | | `xxxxxl` | `--ds-font-size-xxxxxl` | `96` | **Font weights** | Token | Custom property | Value | | --- | --- | --- | | `body` | `--ds-font-weight-body` | `400` | | `medium` | `--ds-font-weight-medium` | `500` | | `heading` | `--ds-font-weight-heading` | `600` | | `bold` | `--ds-font-weight-bold` | `700` | | `semibold` | `--ds-font-weight-semibold` | `600` | **Line heights** | Token | Custom property | Value | | --- | --- | --- | | `body` | `--ds-line-height-body` | `1.5` | | `heading` | `--ds-line-height-heading` | `1.125` | **Font stacks** | Token | Custom property | Value | | --- | --- | --- | | `body` | `--ds-font-body` | `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif` | | `heading` | `--ds-font-heading` | `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif` | | `monospace` | `--ds-font-monospace` | `ui-monospace, SFMono-Regular, Menlo, Consolas, monospace` | **Measures** | Token | Custom property | Value | | --- | --- | --- | | `sm` | `--ds-measure-sm` | `26rem` | | `md` | `--ds-measure-md` | `38rem` | | `lg` | `--ds-measure-lg` | `46rem` | **Breakpoints** | Token | Custom property | Value | | --- | --- | --- | | `sm` | `--ds-breakpoint-sm` | `40rem` | | `md` | `--ds-breakpoint-md` | `48rem` | | `lg` | `--ds-breakpoint-lg` | `64rem` | | `xl` | `--ds-breakpoint-xl` | `80rem` | **Border radius** | Token | Custom property | Value | | --- | --- | --- | | `none` | `--ds-border-radius-none` | `0` | | `button` | `--ds-border-radius-button` | `4px` | | `pill` | `--ds-border-radius-pill` | `9999px` | | `circle` | `--ds-border-radius-circle` | `50%` | | `sm` | `--ds-border-radius-sm` | `4px` | | `md` | `--ds-border-radius-md` | `8px` | | `xl` | `--ds-border-radius-xl` | `12px` | | `xxl` | `--ds-border-radius-xxl` | `16px` | | `xxxl` | `--ds-border-radius-xxxl` | `24px` | **Border widths** | Token | Custom property | Value | | --- | --- | --- | | `none` | `--ds-border-width-none` | `0` | | `sm` | `--ds-border-width-sm` | `1px` | | `md` | `--ds-border-width-md` | `2px` | | `lg` | `--ds-border-width-lg` | `4px` | **Shadows** | Token | Custom property | Value | | --- | --- | --- | | `sm` | `--ds-shadow-sm` | `0 1px 2px var(--ds-slate-a3)` | | `md` | `--ds-shadow-md` | `0 1px 2px var(--ds-slate-a3), 0 4px 12px var(--ds-slate-a4)` | | `lg` | `--ds-shadow-lg` | `0 4px 8px var(--ds-slate-a3), 0 16px 40px var(--ds-slate-a6)` | **Z-index** | Token | Custom property | Value | | --- | --- | --- | | `dropdown` | `--ds-z-dropdown` | `1000` | | `sticky` | `--ds-z-sticky` | `1100` | | `drawer` | `--ds-z-drawer` | `1200` | | `overlay` | `--ds-z-overlay` | `1300` | | `modal` | `--ds-z-modal` | `1400` | | `toast` | `--ds-z-toast` | `1500` | **Durations** | Token | Custom property | Value | | --- | --- | --- | | `instant` | `--ds-duration-instant` | `1ms` | | `fast` | `--ds-duration-fast` | `100ms` | | `normal` | `--ds-duration-normal` | `200ms` | | `slow` | `--ds-duration-slow` | `300ms` | **Easings** | Token | Custom property | Value | | --- | --- | --- | | `standard` | `--ds-easing-standard` | `cubic-bezier(0.2, 0, 0, 1)` | | `emphasized` | `--ds-easing-emphasized` | `cubic-bezier(0.16, 1, 0.3, 1)` | | `linear` | `--ds-easing-linear` | `linear` | **Control heights** | Token | Custom property | Value | | --- | --- | --- | | `sm` | `--ds-control-height-sm` | `28px` | | `md` | `--ds-control-height-md` | `32px` | | `lg` | `--ds-control-height-lg` | `40px` | **Icon sizes** | Token | Custom property | Value | | --- | --- | --- | | `sm` | `--ds-icon-size-sm` | `16px` | | `md` | `--ds-icon-size-md` | `20px` | **Layout** | Token | Custom property | Value | | --- | --- | --- | | `sidebar-width` | `--ds-sidebar-width` | `280px` | ================================================================================ title: Themes section: Foundations url: https://design-system.blocks-ui.com/foundations/themes markdown: https://design-system.blocks-ui.com/foundations/themes.md ================================================================================ # Themes Tokens follow the reader’s light or dark preference. Any element can choose a theme for its subtree with `data-ds-theme`: `"light"`, `"dark"`, or `"system"` to return to the preference inside a forced theme. Only the semantic `--ds-color-*` tokens change between themes. ```html ``` **Example: Adjacent themes** (`examples/themes/adjacent-themes.tsx`) ```tsx const panel = { padding: 'var(--ds-space-lg)', color: 'var(--ds-color-text)', backgroundColor: 'var(--ds-color-bg)', border: 'var(--ds-border-width-sm) solid var(--ds-color-border)', borderRadius: 'var(--ds-border-radius-md)', } export default function AdjacentThemes() { return (

Always light

Accent text

Always dark

Accent text

) } ``` ## Popups in a themed subtree Select, Modal, Popover, Tooltip and Menu render their popups in a portal at the end of `document.body`, which is outside any `data-ds-theme` subtree. Pass `container` to their content part with an element inside the subtree, and the popup inherits its theme. [Select](https://design-system.blocks-ui.com/components/select.md) and [Modal](https://design-system.blocks-ui.com/components/modal.md) show it. ## Embed in another page An editor or widget that ships into someone else’s page should not set variables on the host’s `:root` or claim the host’s font names. Build its stylesheet with `renderTokensCss` from `@blocks/design-system/tokens` at build time: every token is scoped to your root selector, themes work on that root and its descendants, and font families can be renamed. `examples/themes/build-editor-css.ts`: ```ts // Builds a stylesheet for an embedded editor. Every token lives on // .example-editor instead of :root, and the editor's font has a private // family name, so the host page keeps its own colors and fonts. import { writeFileSync } from 'node:fs' import { renderTokensCss } from '@blocks/design-system/tokens' const css = renderTokensCss({ selector: '.example-editor', banner: '/* Example editor tokens, generated by build-editor-css.ts. */', fontFaces: [{ family: 'Serif', src: 'local("Georgia"), local("Times New Roman")' }], fontFamilyNames: { Serif: 'Example Editor Serif' }, fonts: { body: '"Serif", Georgia, serif', heading: '"Serif", Georgia, serif' }, }) const editorRules = ` .example-editor { font-family: var(--ds-font-body); color: var(--ds-color-text); background-color: var(--ds-color-bg); border: var(--ds-border-width-sm) solid var(--ds-color-border); border-radius: var(--ds-border-radius-md); padding: var(--ds-space-lg); } ` writeFileSync(new URL('./editor.css', import.meta.url), `${css}${editorRules}`) ``` **Example: An embedded editor in a host page** (`examples/themes/embedded-editor.tsx`) ```tsx import './editor.css' export default function EmbeddedEditor() { return (

This paragraph belongs to the host page and keeps its own color and font.

The editor follows the reader’s light or dark preference.

This editor is always dark.

) } ``` `renderTokensCss` options: | Option | Purpose | | --- | --- | | `selector` | The element that owns the tokens. Defaults to `:root`. | | `fonts` | Replaces `body`, `heading` or `monospace` font stacks. | | `fontFaces` | `@font-face` rules to include. | | `fontFamilyNames` | Private names for families, applied to faces and font tokens. | | `assetBaseUrl` | Prefix for relative font `url()`s, e.g. `"./fonts/"`. | | `banner` | The comment at the top of the stylesheet. | ================================================================================ title: Typography and fonts section: Foundations url: https://design-system.blocks-ui.com/foundations/typography-and-fonts markdown: https://design-system.blocks-ui.com/foundations/typography-and-fonts.md ================================================================================ # Typography and fonts Type comes from three font tokens, `--ds-font-body`, `--ds-font-heading` and `--ds-font-monospace`, plus the size, weight and line-height scales. Text, Heading, Body and Code apply them. **Example: Font tokens** (`examples/foundations/font-tokens.tsx`) ```tsx import { Code, Stack, Text } from '@blocks/design-system' export default function FontTokens() { return ( Body text uses --ds-font-body. Headings use --ds-font-heading. Code uses --ds-font-monospace. ) } ``` ## System fonts by default `tokens.css` and `styles.css` use the platform’s system stacks, so nothing is downloaded unless you ask for it. ## Geist, optionally `@blocks/design-system/fonts/geist.css` adds Geist and Geist Mono (SIL Open Font License) with metric-matched fallback faces, and points the font tokens at them. Import it after `styles.css`. Its font files are referenced relative to the stylesheet, so they resolve from the installed package; [this page](https://design-system.blocks-ui.com/demos/reset-and-fonts) loads them. ```tsx import '@blocks/design-system/styles.css' import '@blocks/design-system/fonts/geist.css' ``` ## Your own fonts Override the font tokens in your CSS, or use a theme: Heading reads `--ds-font-heading`, so a serif heading face is one declaration. An embedded stylesheet can rename families so it never claims the host’s fonts; see [Themes](https://design-system.blocks-ui.com/foundations/themes.md). ```css :root { --ds-font-heading: 'Source Serif 4', Georgia, serif; } ``` ================================================================================ title: Responsive layout section: Foundations url: https://design-system.blocks-ui.com/foundations/responsive-layout markdown: https://design-system.blocks-ui.com/foundations/responsive-layout.md ================================================================================ # Responsive layout Four breakpoints are minimum widths: `sm` 40rem, `md` 48rem, `lg` 64rem and `xl` 80rem. They are rems, so they follow the reader’s font size. ## Responsive props Every Box layout prop, and the props of Stack, Grid and the components built on Box, takes either a value or an object keyed by breakpoint. `base` applies everywhere; each breakpoint applies from that width up. The classes are generated at build time, so this works on the server with no JavaScript. **Example: Responsive props** (`examples/foundations/responsive-props.tsx`) ```tsx import { Box, Grid, Stack } from '@blocks/design-system' export default function ResponsiveProps() { return ( Padding and alignment change at md (48rem). {['Depth', 'New snow', 'Wind', 'Temperature'].map((label) => ( {label} ))} ) } ``` ## Media queries in your CSS The package’s own CSS writes `@media (--ds-md)` and expands it at build time. In your CSS, use the same widths: `@media (width >= 48rem)`. The values are also available as `tokens.breakpoints` from `@blocks/design-system/tokens`. ## Reading order Responsive props change the visual arrangement only. Keep the source order meaningful, since screen readers and the Tab key follow it, and avoid reversed directions for content people read. ================================================================================ title: Reset section: Foundations url: https://design-system.blocks-ui.com/foundations/reset markdown: https://design-system.blocks-ui.com/foundations/reset.md ================================================================================ # Reset `styles.css` only defines tokens and component classes; it never restyles your elements. The global reset is opt-in. ```tsx import '@blocks/design-system/styles.css' import '@blocks/design-system/reset.css' ``` It sets: - `box-sizing: border-box` on every element. - The body’s margin, font, line height and colors from the tokens. - The monospace font on `code`, `kbd`, `pre` and `samp`. - A visible keyboard focus outline in the focus-ring color on every focusable element. - Under `prefers-reduced-motion: reduce`, animations and transitions collapse to `--ds-duration-instant`, and smooth scrolling is turned off. Components keep their own essential focus treatment, so they stay accessible in an app that doesn’t load the reset. The [reset demo](https://design-system.blocks-ui.com/demos/reset-and-fonts) loads it with Geist. ================================================================================ title: Composition section: Foundations url: https://design-system.blocks-ui.com/foundations/composition markdown: https://design-system.blocks-ui.com/foundations/composition.md ================================================================================ # Composition ## Server-authored and client-authored code The package root has no client directive. Static components such as Box, Text, Button, Card and Table render on the server and in client components alike. Interactive components (Tabs, Field, Select, Modal, Menu, NavList, AppLayout and the other Base UI parts) are client components that a Server Component can still render. - **In a Server Component**, import compound parts by name: `TabsList`, `FieldLabel`, `ModalContent`. A Server Component can’t read properties of a client component, so `Tabs.List` there fails. - **In a `'use client'` file**, the dot API works too: `Tabs.List`, `Field.Label`. Both spellings are the same components, sharing one context. - Event handlers, state and refs belong in client-authored code. A plain submit button in a server-rendered form needs none of them. [Installation](https://design-system.blocks-ui.com/getting-started/installation.md) shows a Server Component page with a heading and Tabs; [Field](https://design-system.blocks-ui.com/components/field.md) and [Select](https://design-system.blocks-ui.com/components/select.md) show both styles. ## Controlled and uncontrolled Interactive components take `defaultValue`, `defaultChecked` or `defaultOpen` to manage themselves, or `value`/`checked`/`open` with a change handler when the caller owns the state. ## Changing the element - **`as`** on Box and the components built on it (Stack, Grid, Measure, Card, Text, Heading, Link, Button) renders another element or component and keeps its props typed: ``, ``. A Server Component can pass a server-local component. - **`render`** on Base UI parts replaces the rendered element while keeping behavior: a trigger rendered as a Button. **Example: Triggers rendered as Buttons** (`examples/foundations/render-composition.tsx`) ```tsx 'use client' import { Button, Menu, Popover, Stack } from '@blocks/design-system' // `render` gives a Base UI part another element; here each trigger is a Button. export default function RenderComposition() { return ( }>Station actions Resync }>Station notes Notes Pillow replaced in 2024. ) } ``` ## Refs, ids and ARIA Every component forwards `ref`, `id`, `aria-*` and native attributes to its element. Base UI parts wire ids between labels, controls and popups for you. ## Escape hatches Components take no `className` or `style`. When you need styling outside the tokens, `dangerouslySetClassName` and `dangerouslySetStyle` apply after the component’s own, and are easy to search for. **Example: Escape hatches** (`examples/foundations/escape-hatches.tsx`) ```tsx import { Card, Heading } from '@blocks/design-system' // No className or style props: escape hatches say so out loud. export default function EscapeHatches() { return ( Mount Hood ) } ``` ## Themes and portals Popups render in a portal at the end of `document.body`. Inside a subtree with its own `data-ds-theme`, pass `container` to `SelectContent`, `ModalContent` or a popover, tooltip or menu’s `Content` so the popup inherits the theme. See [Themes](https://design-system.blocks-ui.com/foundations/themes.md). ================================================================================ title: Style helpers section: Foundations url: https://design-system.blocks-ui.com/foundations/style-helpers markdown: https://design-system.blocks-ui.com/foundations/style-helpers.md ================================================================================ # Style helpers The style helpers return the same token classes the components use, for native elements the package doesn’t wrap. They don’t call React hooks, despite the `use` prefix, so they work in Server Components. ```tsx import { clsx, cva, useBorderRadius, useBorderStyle, useFontFamily, useFontWeight, useMargin, usePadding } from '@blocks/design-system' ``` **Example: Styling a native element** (`examples/foundations/style-helpers.tsx`) ```tsx // The style helpers return class names from the tokens, for elements the // package doesn't wrap. None calls a React hook, so they work on the server. import { clsx, cva, useBorderRadius, useBorderStyle, useFontFamily, useFontWeight, useMargin, usePadding, } from '@blocks/design-system' const reading = cva({ base: 'reading', variants: { state: { fresh: 'reading-fresh', stale: 'reading-stale' } } }) export default function StyleHelpers() { const padding = usePadding({ paddingX: 'md', paddingY: 'sm' }).className const margin = useMargin({ marginBottom: 'sm' }).className const border = useBorderStyle({ borderColor: 'border', borderWidth: 'sm', borderStyle: 'dashed' }).className const radius = useBorderRadius({ borderRadius: 'md' }).className const font = useFontFamily({ fontFamily: 'monospace' }).className const weight = useFontWeight({ fontWeight: 'semibold' }).className return (
Latest raw reading
SD=84.0in SWE=31.2in T=-4.1C
) } ``` | Helper | Returns | | --- | --- | | `usePadding(props)` | `{ className, restProps }` for `padding`, `paddingX`… (responsive) | | `useMargin(props)` | `{ className, restProps }` for `margin`, `marginX`… (responsive) | | `useBorderStyle(props)` | `{ className }` for `borderColor`, `borderWidth`, `borderStyle` | | `useBorderRadius(props)` | `{ className }` for `borderRadius` | | `useFontFamily(props)` | `{ className }` for `fontFamily` | | `useFontWeight(props)` | `{ className }` for `fontWeight` | | `useControlClassName(props)` | Input’s control classes, see [Label, Input and Textarea](https://design-system.blocks-ui.com/components/inputs.md) | | `clsx(...values)` | Joined class names, skipping falsy values | | `cva(config)` | A function from variant props to class names | ================================================================================ title: Box section: Components: Layout url: https://design-system.blocks-ui.com/components/box markdown: https://design-system.blocks-ui.com/components/box.md ================================================================================ # Box The layout primitive. Every style prop maps to a design token, and every prop is responsive. Reach for Box when an element needs spacing, color, borders or flex layout; use Stack or Grid to lay out a list of children. ```tsx import { Box } from '@blocks/design-system' ``` Box has no client directive. It renders in a Server Component, a Client Component, or plain React without a framework. ## Usage **Example: box/basic.tsx** (`examples/box/basic.tsx`) ```tsx import { Box } from '@blocks/design-system' export default function Basic() { return ( Plan Review ) } ``` ## Rows and columns Set `display="flex"` and `flexDirection`. The visual order follows the DOM order, which is also the reading and Tab order. **Example: box/direction.tsx** (`examples/box/direction.tsx`) ```tsx import { Box } from '@blocks/design-system' const steps = ['Fetch diff', 'Review', 'Comment'] export default function Direction() { return ( {steps.map((step) => ( {step} ))} {steps.map((step) => ( {step} ))} ) } ``` ## Responsive values Pass an object keyed by breakpoint instead of a single value: `base` applies everywhere, and `sm` (40rem), `md` (48rem), `lg` (64rem) and `xl` (80rem) apply from that width up. This summary stacks below `md` and becomes a row above it. **Example: Responsive station summary** (`examples/box/responsive-summary.tsx`) ```tsx import { Box } from '@blocks/design-system' export default function ResponsiveSummary() { return ( Mount Hood, 5,370 ft Snow depth 84 in · updated 6:00 AM View station history ) } ``` ## Spacing `padding`, `margin` and their `X`, `Y`, `Top`, `Right`, `Bottom` and `Left` variants take a space token, doubling from 1px: `none`, `xxs`, `xs`, `sm`, `md`, `lg`, `xl`, `xxl`, `xxxl`, `xxxxl`, `xxxxxl`. Margins also take `"auto"`. `maxWidth` takes a measure token, `sm` (26rem), `md` (38rem) or `lg` (46rem). **Example: box/spacing.tsx** (`examples/box/spacing.tsx`) ```tsx import { Box } from '@blocks/design-system' export default function Spacing() { return ( paddingX="lg" paddingY="sm" marginBottom="md" marginX="auto" maxWidth="sm" ) } ``` ## Rendering another element `as` renders a different element and keeps that element’s attributes typed. Prefer the element with the right semantics, such as `as="nav"` or `as="article"`, over adding a `role`. **Example: box/as-element.tsx** (`examples/box/as-element.tsx`) ```tsx import { Box } from '@blocks/design-system' export default function AsElement() { return ( Conditions History ) } ``` Pass a component when it accepts `className`, such as `next/link`. In a Server Component the component can be a local server function: Box never crosses into the client, so nothing has to be serialized. **Example: box/as-component.tsx** (`examples/box/as-component.tsx`) ```tsx import { Box } from '@blocks/design-system' import Link from 'next/link' // Any component that accepts className works as the host. Box keeps the // component's own props, such as next/link's href, fully typed. export default function AsComponent() { return ( Jump to refs with next/link ) } ``` ## Refs Box forwards `ref` to the element it renders, along with IDs, ARIA attributes and event handlers. An event handler or ref means the caller is a Client Component. **Example: box/ref-focus.tsx** (`examples/box/ref-focus.tsx`) ```tsx 'use client' import { Box } from '@blocks/design-system' import { useRef } from 'react' export default function RefFocus() { const input = useRef(null) return ( Station input.current?.focus()}> Focus the search ) } ``` ## Escape hatches Box takes no `className` or `style`. When a value has no token, use `dangerouslySetClassName` or `dangerouslySetStyle`, applied after Box’s own classes and styles, so the exceptions are easy to search for. **Example: box/escape-hatch.tsx** (`examples/box/escape-hatch.tsx`) ```tsx import { Box } from '@blocks/design-system' export default function EscapeHatch() { return ( A one-off dashed outline ) } ``` ## Props **`Box` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `alignItems` | `ResponsiveValue` | — | Aligns children on the cross axis. Responsive. | | `alignSelf` | `ResponsiveValue` | — | Overrides the parent's `alignItems` for this element. Responsive. | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `backgroundColor` | `ResponsiveValue<"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| ... 24 more ... \| "text-muted">` | — | A background color token, e.g. `"surface"`. Responsive. | | `border` | `ResponsiveValue` | — | A border on all sides: `none`, `default`, `accent` or `danger`. Responsive. | | `borderBottom` | `ResponsiveValue` | — | A bottom border: `none`, `default`, `accent` or `danger`. Responsive. | | `borderLeft` | `ResponsiveValue` | — | A left border: `none`, `default`, `accent` or `danger`. Responsive. | | `borderRight` | `ResponsiveValue` | — | A right border: `none`, `default`, `accent` or `danger`. Responsive. | | `borderTop` | `ResponsiveValue` | — | A top border: `none`, `default`, `accent` or `danger`. Responsive. | | `color` | `ResponsiveValue<"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| ... 24 more ... \| "text-muted">` | — | A text color token. Responsive. | | `display` | `ResponsiveValue` | — | The CSS `display`. Responsive. | | `flex` | `ResponsiveValue<"none" \| "auto" \| "initial" \| "1">` | — | The CSS `flex` shorthand. Responsive. | | `flexDirection` | `ResponsiveValue` | — | The flex main axis. Responsive. | | `flexGrow` | `ResponsiveValue<0 \| 1>` | — | `1` to grow into free space. Responsive. | | `flexShrink` | `ResponsiveValue<0 \| 1>` | — | `0` to stop shrinking below its size. Responsive. | | `flexWrap` | `ResponsiveValue` | — | Whether flex children wrap. Responsive. | | `gap` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | A space token between flex or grid children, e.g. `"md"`. Responsive. | | `height` | `ResponsiveValue` | — | A space token, `"100vh"` or `"full"`. Responsive. | | `justifyContent` | `ResponsiveValue` | — | Distributes children along the main axis. Responsive. | | `margin` | `ResponsiveValue` | — | Margin on all sides. A space token or `"auto"`, e.g. `"md"`. Responsive. | | `marginBottom` | `ResponsiveValue` | — | Margin on the bottom. A space token or `"auto"`, e.g. `"md"`. Responsive. | | `marginLeft` | `ResponsiveValue` | — | Margin on the left. A space token or `"auto"`, e.g. `"md"`. Responsive. | | `marginRight` | `ResponsiveValue` | — | Margin on the right. A space token or `"auto"`, e.g. `"md"`. Responsive. | | `marginTop` | `ResponsiveValue` | — | Margin on the top. A space token or `"auto"`, e.g. `"md"`. Responsive. | | `marginX` | `ResponsiveValue` | — | Margin on the left and right. A space token or `"auto"`, e.g. `"md"`. Responsive. | | `marginY` | `ResponsiveValue` | — | Margin on the top and bottom. A space token or `"auto"`, e.g. `"md"`. Responsive. | | `maxHeight` | `ResponsiveValue` | — | A space token, `"100vh"` or `"full"`. Responsive. | | `maxWidth` | `ResponsiveValue` | — | A measure token (`sm`, `md`, `lg`), `"100vw"` or `"full"`. Responsive. | | `minHeight` | `ResponsiveValue` | — | A space token, `"100vh"` or `"full"`. Responsive. | | `padding` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | Padding on all sides. A space token, e.g. `"md"`. Responsive. | | `paddingBottom` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | Padding on the bottom. A space token, e.g. `"md"`. Responsive. | | `paddingLeft` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | Padding on the left. A space token, e.g. `"md"`. Responsive. | | `paddingRight` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | Padding on the right. A space token, e.g. `"md"`. Responsive. | | `paddingTop` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | Padding on the top. A space token, e.g. `"md"`. Responsive. | | `paddingX` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | Padding on the left and right. A space token, e.g. `"md"`. Responsive. | | `paddingY` | `ResponsiveValue<"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "none">` | — | Padding on the top and bottom. A space token, e.g. `"md"`. Responsive. | | `position` | `ResponsiveValue` | — | The CSS `position`. Responsive. | | `textAlign` | `ResponsiveValue` | — | The CSS `text-align`. Responsive. | | `width` | `ResponsiveValue` | — | A space token, `"100vw"` or `"full"`. Responsive. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), and the native attributes of the element it renders. ## Accessibility - Box renders a `
`, which has no role. Choose the element with `as` (`nav`, `section`, `article`, `ul`), and give landmarks a name with `aria-label` or `aria-labelledby`. - `flexDirection` and responsive layout change only the visual arrangement. Keep the source order meaningful, because screen readers and the keyboard follow it. - Color props take semantic tokens, which keep text readable in both themes. ================================================================================ title: Stack section: Components: Layout url: https://design-system.blocks-ui.com/components/stack markdown: https://design-system.blocks-ui.com/components/stack.md ================================================================================ # Stack Lays out its children in a column or a row with a token gap between them. It is a Box with `display="flex"`, so it takes every Box prop, renders on the server, and keeps `as` for semantics. ```tsx import { Stack } from '@blocks/design-system' ``` ## Usage A Stack is a column with a `md` gap unless you say otherwise. **Example: Release steps** (`examples/stack/vertical.tsx`) ```tsx import { Box, Stack } from '@blocks/design-system' export default function Vertical() { return ( {['Freeze the branch', 'Run verification', 'Pack the tarball'].map((step) => ( {step} ))} ) } ``` ## Rows that wrap `direction="row"` with `wrap="wrap"` lets a list of actions flow onto more lines on a narrow screen. Use native links for navigation and native buttons for actions; the reading and Tab order stay the source order. **Example: Wrapping item actions** (`examples/stack/item-actions.tsx`) ```tsx import { Box, Stack } from '@blocks/design-system' const actions = ['Edit item', 'Duplicate', 'Move to another board', 'Copy link', 'Archive'] export default function ItemActions() { return ( {actions.map((action) => ( {action} ))} Delete ) } ``` ## Spreading items `justify` distributes children along the main axis and `align` places them on the cross axis. **Example: Header with a trailing link** (`examples/stack/spread.tsx`) ```tsx import { Box, Stack } from '@blocks/design-system' export default function Spread() { return ( Launch checklist Settings ) } ``` ## Responsive Every prop takes a breakpoint object. These actions stack full-width below `md` and sit side by side above it. **Example: Responsive actions** (`examples/stack/responsive-actions.tsx`) ```tsx import { Box, Stack } from '@blocks/design-system' export default function ResponsiveActions() { return ( Approve changes Request changes ) } ``` ## Props **`Stack` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `align` | `ResponsiveValue` | — | Cross axis alignment. Responsive. | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `direction` | `ResponsiveValue` | `column` | Main axis. Defaults to `"column"`. Responsive. | | `justify` | `ResponsiveValue` | — | Main axis distribution. Responsive. | | `wrap` | `ResponsiveValue<"nowrap" \| "wrap" \| "wrap-reverse">` | — | Whether children wrap onto new lines. Responsive. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [padding props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. ## Accessibility - Avoid `row-reverse` and `column-reverse` for content people read or tab through: the visual order would no longer match the order screen readers and the keyboard follow. - Give a Stack rendered `as="nav"` a name with `aria-label`. ================================================================================ title: Grid section: Components: Layout url: https://design-system.blocks-ui.com/components/grid markdown: https://design-system.blocks-ui.com/components/grid.md ================================================================================ # Grid A CSS grid of equal columns, or a custom column template. Grid is a Box, so it takes every Box prop and renders on the server. ```tsx import { Grid } from '@blocks/design-system' ``` ## Usage `columns` takes a count from 1 to 12. Columns share the width equally and never grow past it because of long content. **Example: Four equal columns** (`examples/grid/fixed-columns.tsx`) ```tsx import { Box, Grid } from '@blocks/design-system' export default function FixedColumns() { return ( {['Depth', 'New snow', 'Wind', 'Temp'].map((label) => ( {label} ))} ) } ``` ## Responsive columns Pass a breakpoint object to change the count with the screen width. The station catalog is a single readable list below `md` (48rem) and three columns from `md` up, with the same markup and reading order. **Example: Station catalog** (`examples/grid/station-catalog.tsx`) ```tsx import { Box, Grid } from '@blocks/design-system' const stations = [ { name: 'Mount Hood', state: 'Oregon', depth: '84 in' }, { name: 'Stevens Pass', state: 'Washington', depth: '61 in' }, { name: 'Alta', state: 'Utah', depth: '102 in' }, { name: 'Mammoth', state: 'California', depth: '77 in' }, { name: 'Big Sky', state: 'Montana', depth: '55 in' }, { name: 'Taos', state: 'New Mexico', depth: '38 in' }, ] export default function StationCatalog() { return ( {stations.map((station) => ( {station.name} {station.state} · {station.depth} ))} Browse all stations ) } ``` ## Custom templates A string becomes `grid-template-columns`. Custom templates are not responsive; reach for a count when the layout should change with the width. **Example: Sidebar and results** (`examples/grid/custom-template.tsx`) ```tsx import { Box, Grid } from '@blocks/design-system' export default function CustomTemplate() { return ( Filters Results ) } ``` ## Props **`Grid` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `columns` | `string \| ResponsiveValue` | `1` | Equal columns, from 1 to 12, or a `grid-template-columns` value. A count is responsive, e.g. `{ base: 1, md: 3 }`. Defaults to `1`. | | `gap` | `ResponsiveValue<"sm" \| "md" \| "lg" \| "xl">` | `md` | `sm`, `md`, `lg` or `xl`. Defaults to `"md"`. Responsive. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [padding props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. ## Accessibility - Render lists of cards `as="ul"` with `as="li"` children so screen readers announce the count. - A grid places items in source order, row by row. Keep that order meaningful rather than positioning items out of order. ================================================================================ title: Measure section: Components: Layout url: https://design-system.blocks-ui.com/components/measure markdown: https://design-system.blocks-ui.com/components/measure.md ================================================================================ # Measure Caps text at a readable line length, roughly 45 to 80 characters, and centers it. Use it around articles, guides and long form fields; layout components take the full width. ```tsx import { Measure } from '@blocks/design-system' ``` ## Usage Wrap long text. Measure renders a `
` unless you pass `as`, so an article can be the Measure itself. **Example: Field notes** (`examples/measure/field-notes.tsx`) ```tsx import { Box, Measure } from '@blocks/design-system' export default function FieldNotes() { return ( Reading a snow course

A snow course is a line of marked points where observers measure depth and water content by hand. The same points are sampled near the first of each month, so a season’s readings can be compared with decades of earlier ones without worrying that the observer chose easier ground.

Automated stations report every hour, which makes them better for storms and melt, but a single sensor can be fooled by drifting. When the two disagree, the manual course is usually the better guide to how much water the basin holds, and the station is the better guide to when it changed.

Next: comparing seasons
) } ``` ## Sizes `size` takes a measure token: `sm` (26rem), `md` (38rem, the default) or `lg` (46rem). The tokens are rems rather than `ch`, so a line doesn’t change length when a web font replaces the fallback. On a screen narrower than the measure, Measure is simply the full width. Pass `marginX="none"` to align it to the start instead of centering. **Example: Measure sizes** (`examples/measure/sizes.tsx`) ```tsx import { Box, Measure, Stack } from '@blocks/design-system' export default function Sizes() { return ( {(['sm', 'md', 'lg'] as const).map((size) => ( size="{size}" ))} ) } ``` ## Props **`Measure` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `size` | `"sm" \| "md" \| "lg"` | `md` | A measure token: `sm` (26rem), `md` (38rem) or `lg` (46rem). Defaults to `"md"`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [padding props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. ## Accessibility - Short lines are easier to track from one line to the next, especially when text is enlarged. - Measure sets only a maximum width, so text still reflows when zoomed. ================================================================================ title: Separator section: Components: Layout url: https://design-system.blocks-ui.com/components/separator markdown: https://design-system.blocks-ui.com/components/separator.md ================================================================================ # Separator A line between groups of content or actions, on Base UI. It renders `role="separator"` with `aria-orientation`, so screen readers perceive the division. ```tsx import { Separator } from '@blocks/design-system' ``` ## Between content Horizontal is the default: a full-width line between sections. **Example: Station summary** (`examples/separator/sections.tsx`) ```tsx import { Body, Heading, Separator, Stack } from '@blocks/design-system' export default function Sections() { return ( Today 4 in of new snow, light wind. This week Storm totals near 18 in. {/* Purely visual: hidden from assistive technology. */} ) } ``` ## Between action groups Set `orientation="vertical"` in a row. The separator stretches to the row’s height. Label the groups on either side so the division means something when read aloud. **Example: Item tools** (`examples/separator/item-toolbar.tsx`) ```tsx import { Button, Separator, Stack } from '@blocks/design-system' export default function ItemToolbar() { return ( ) } ``` ## Decorative lines When a line only decorates and divides nothing meaningful, hide it with `aria-hidden="true"`, as the last line in the summary does. Separators are never focusable either way. ## Props **`Separator` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `orientation` | `"horizontal" \| "vertical"` | `'horizontal'` | The orientation of the separator. | | `render` | `ReactElement> \| ComponentRenderFn` | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. ## Accessibility - Don’t use a separator to replace a heading; give each section one. - A vertical separator in a toolbar is read between the groups it divides. ================================================================================ title: Typography section: Components: Content url: https://design-system.blocks-ui.com/components/typography markdown: https://design-system.blocks-ui.com/components/typography.md ================================================================================ # Typography `Text`, `Heading`, `Body` and `BodySmall` set text from the font, size, weight, line-height and color tokens. Each renders on the server. The element is chosen separately from the size, so the document outline stays correct whatever the visual design. ```tsx import { Body, BodySmall, Heading, Text } from '@blocks/design-system' ``` ## An article **Example: Station guide** (`examples/typography/station-guide.tsx`) ```tsx import { Body, BodySmall, Heading, Measure, Text } from '@blocks/design-system' export default function StationGuide() { return ( Station guide Each station reports snow depth, water content and temperature. Readings arrive hourly and are checked against nearby stations before they appear here. Snow depth Depth is measured by an ultrasonic sensor above a level board. Sudden drops{' '} usually mean wind, not melt. Sensor accuracy is about half an inch. Water content Snow water equivalent is the depth of water the snowpack would make if it all melted at once. ) } ``` ## Text `Text` is the base the others build on. It renders a `` unless you pass `as`, and takes `fontSize`, `fontWeight`, `fontFamily`, `lineHeight` and `color` tokens plus margin props. Colors are semantic tokens such as `text-muted` and `danger-text`, which stay readable in both themes. **Example: Text tokens** (`examples/typography/text-tokens.tsx`) ```tsx import { Stack, Text } from '@blocks/design-system' export default function TextTokens() { return ( Storm total 18 in Since Tuesday evening STN-651 · 05:00 UTC Avalanche warning in effect ) } ``` ## Headings `Heading` renders an `

` in the heading font, size and weight unless you pass `as` (`h1`–`h6` or `span`). Pick the level for the outline and `fontSize` for the look. A `span` gives heading styling to text that should not appear in the outline. Themes change heading type through `--ds-font-heading`. **Example: Levels and sizes** (`examples/typography/heading-levels.tsx`) ```tsx import { Heading, Stack } from '@blocks/design-system' export default function HeadingLevels() { return ( A second-level heading at the lg size A third-level heading at the xxl size A heading style on a span, outside the outline ) } ``` ## Body text `Body` is a paragraph at the `md` size and `BodySmall` one at `sm`, for captions, notes and secondary details. Pass `as="span"` for inline text. ## Props **`Text` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `color` | `"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| "accent-hover" \| "accent-fg" \| "accent-subtle" \| "accent-text" \| "danger" \| "danger-hover" \| "danger-fg" \| "danger-subtle" \| "danger-text" \| "warning" \| "warning-hover" \| "warning-fg" \| "warning-subtle" \| "warning-text" \| "success" \| "success-hover" \| "success-fg" \| "success-subtle" \| "success-text" \| "info" \| "info-hover" \| "info-fg" \| "info-subtle" \| "info-text" \| "text-muted"` | `text` | A color token. Defaults to `"text"`. | | `fontFamily` | `"body" \| "heading" \| "monospace"` | — | A font token: `body`, `heading` or `monospace`. | | `fontSize` | `"body" \| "code" \| "heading" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "inherit"` | `body` | A font size token, e.g. `"sm"` or `"heading"`, or `"inherit"` to keep the parent's size. Defaults to `"body"`. | | `fontWeight` | `"body" \| "heading" \| "medium" \| "bold" \| "semibold"` | — | A font weight token: `body`, `medium`, `semibold`, `heading` or `bold`. | | `lineHeight` | `"body" \| "heading" \| "inherit"` | `body` | `body` or `heading`, or `"inherit"` to keep the parent's. Defaults to `"body"`. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches) and [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. **`Heading` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | `h3` | A heading level from `"h1"` to `"h6"`, or `"span"`. Defaults to `"h3"`. | | `color` | `"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| "accent-hover" \| "accent-fg" \| "accent-subtle" \| "accent-text" \| "danger" \| "danger-hover" \| "danger-fg" \| "danger-subtle" \| "danger-text" \| "warning" \| "warning-hover" \| "warning-fg" \| "warning-subtle" \| "warning-text" \| "success" \| "success-hover" \| "success-fg" \| "success-subtle" \| "success-text" \| "info" \| "info-hover" \| "info-fg" \| "info-subtle" \| "info-text" \| "text-muted"` | — | A color token. Defaults to `"text"`. | | `fontFamily` | `"body" \| "heading" \| "monospace"` | — | A font token: `body`, `heading` or `monospace`. | | `fontSize` | `"body" \| "code" \| "heading" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "inherit"` | — | A font size token, e.g. `"sm"` or `"heading"`, or `"inherit"` to keep the parent's size. Defaults to `"body"`. | | `fontWeight` | `"body" \| "heading" \| "medium" \| "bold" \| "semibold"` | — | A font weight token: `body`, `medium`, `semibold`, `heading` or `bold`. | | `lineHeight` | `"body" \| "heading" \| "inherit"` | — | `body` or `heading`, or `"inherit"` to keep the parent's. Defaults to `"body"`. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`Body` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | `p` | `"p"` or `"span"`. Defaults to `"p"`. | | `color` | `"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| "accent-hover" \| "accent-fg" \| "accent-subtle" \| "accent-text" \| "danger" \| "danger-hover" \| "danger-fg" \| "danger-subtle" \| "danger-text" \| "warning" \| "warning-hover" \| "warning-fg" \| "warning-subtle" \| "warning-text" \| "success" \| "success-hover" \| "success-fg" \| "success-subtle" \| "success-text" \| "info" \| "info-hover" \| "info-fg" \| "info-subtle" \| "info-text" \| "text-muted"` | — | A color token. Defaults to `"text"`. | | `fontFamily` | `"body" \| "heading" \| "monospace"` | — | A font token: `body`, `heading` or `monospace`. | | `fontSize` | `"body" \| "code" \| "heading" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "inherit"` | — | A font size token, e.g. `"sm"` or `"heading"`, or `"inherit"` to keep the parent's size. Defaults to `"body"`. | | `fontWeight` | `"body" \| "heading" \| "medium" \| "bold" \| "semibold"` | — | A font weight token: `body`, `medium`, `semibold`, `heading` or `bold`. | | `lineHeight` | `"body" \| "heading" \| "inherit"` | — | `body` or `heading`, or `"inherit"` to keep the parent's. Defaults to `"body"`. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`BodySmall` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | `p` | `"p"` or `"span"`. Defaults to `"p"`. | | `color` | `"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| "accent-hover" \| "accent-fg" \| "accent-subtle" \| "accent-text" \| "danger" \| "danger-hover" \| "danger-fg" \| "danger-subtle" \| "danger-text" \| "warning" \| "warning-hover" \| "warning-fg" \| "warning-subtle" \| "warning-text" \| "success" \| "success-hover" \| "success-fg" \| "success-subtle" \| "success-text" \| "info" \| "info-hover" \| "info-fg" \| "info-subtle" \| "info-text" \| "text-muted"` | — | A color token. Defaults to `"text"`. | | `fontFamily` | `"body" \| "heading" \| "monospace"` | — | A font token: `body`, `heading` or `monospace`. | | `fontSize` | `"body" \| "code" \| "heading" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "inherit"` | — | A font size token, e.g. `"sm"` or `"heading"`, or `"inherit"` to keep the parent's size. Defaults to `"body"`. | | `fontWeight` | `"body" \| "heading" \| "medium" \| "bold" \| "semibold"` | — | A font weight token: `body`, `medium`, `semibold`, `heading` or `bold`. | | `lineHeight` | `"body" \| "heading" \| "inherit"` | — | `body` or `heading`, or `"inherit"` to keep the parent's. Defaults to `"body"`. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. ## Accessibility - Use one `h1` per page and don’t skip levels: screen reader users move through a page by its headings. - Don’t rely on color alone to carry meaning, as in the warning above, which also says “warning”. - Sizes are rem-based tokens, so text grows with the reader’s font-size setting. ================================================================================ title: Prose, Code and Pre section: Components: Content url: https://design-system.blocks-ui.com/components/prose markdown: https://design-system.blocks-ui.com/components/prose.md ================================================================================ # Prose, Code and Pre Reading styles. `Prose` styles plain HTML you don’t control element by element, such as rendered Markdown. `Code` marks inline code, and `Pre` holds a block that scrolls on its own instead of widening the page. ```tsx import { Code, Pre, Prose } from '@blocks/design-system' ``` ## Prose Wrap rendered HTML in `Prose`: paragraphs, headings, images and code inside it get spacing and type from the tokens. Every rule is scoped to the Prose element, so nothing outside it changes. Prose is a Box and renders a `
` unless you pass `as`. **Example: Release candidate notes** (`examples/prose/install-notes.tsx`) ```tsx import { Code, Pre, Prose } from '@blocks/design-system' export default function InstallNotes() { return (

Checking a release candidate

Install the tarball in a clean app, then compare its digest with the one in the release notes. The command below prints the SHA-256 of blocks-design-system-0.1.0-rc.0.tgz.

        
          shasum -a 256 ./blocks-design-system-0.1.0-rc.0.tgz | tee release-digest.txt && grep -q
          "$(cat expected-digest.txt)" release-digest.txt && echo "digest matches"
        
      

If the digests differ, rebuild from the tagged revision before installing.

Next: installing fonts
) } ``` ## Code `Code` is monospace text at the code size. It renders `` and takes Text’s props, such as `color`. **Example: Inline code** (`examples/prose/inline-code.tsx`) ```tsx import { Body, Code } from '@blocks/design-system' export default function InlineCode() { return ( Set data-ds-theme to "dark" on any element, or import{' '} @blocks/design-system/reset.css for global defaults. ) } ``` ## Pre `Pre` renders a `
` on the surface background. Long lines scroll inside the block. Give a long block `tabIndex={0}` and an `aria-label` so keyboard users can reach it and scroll it with the arrow keys.

**Example: A long response** (`examples/prose/standalone-pre.tsx`)

```tsx
import { Pre } from '@blocks/design-system'

export default function StandalonePre() {
  return (
    
      
        {`{"station":"651:OR:SNTL","name":"Mount Hood Test Site","elevation_ft":5370,"snow_depth_in":84,"swe_in":31.2,"observed_at":"2026-12-01T06:00:00-08:00"}`}
      
    
) } ``` ## Props **`Prose` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [padding props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. **`Code` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | `code` | `"code"`, `"pre"` or `"span"`. Defaults to `"code"`. | | `color` | `"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| "accent-hover" \| "accent-fg" \| "accent-subtle" \| "accent-text" \| "danger" \| "danger-hover" \| "danger-fg" \| "danger-subtle" \| "danger-text" \| "warning" \| "warning-hover" \| "warning-fg" \| "warning-subtle" \| "warning-text" \| "success" \| "success-hover" \| "success-fg" \| "success-subtle" \| "success-text" \| "info" \| "info-hover" \| "info-fg" \| "info-subtle" \| "info-text" \| "text-muted"` | — | A color token. Defaults to `"text"`. | | `fontFamily` | `"body" \| "heading" \| "monospace"` | — | A font token: `body`, `heading` or `monospace`. | | `fontSize` | `"body" \| "code" \| "heading" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "inherit"` | — | A font size token, e.g. `"sm"` or `"heading"`, or `"inherit"` to keep the parent's size. Defaults to `"body"`. | | `fontWeight` | `"body" \| "heading" \| "medium" \| "bold" \| "semibold"` | — | A font weight token: `body`, `medium`, `semibold`, `heading` or `bold`. | | `lineHeight` | `"body" \| "heading" \| "inherit"` | — | `body` or `heading`, or `"inherit"` to keep the parent's. Defaults to `"body"`. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`Pre` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [padding props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. ## Accessibility - Prose doesn’t add landmarks. Give the article or section its own name when it is one. - A scrolling block without a keyboard stop can only be scrolled with a pointer; add `tabIndex={0}` and a label. - Screen readers read code character by character on request, so keep commands copyable rather than splitting them across elements. ================================================================================ title: Link section: Components: Content url: https://design-system.blocks-ui.com/components/link markdown: https://design-system.blocks-ui.com/components/link.md ================================================================================ # Link A text link in the accent color. Link is Text rendered as an ``: it takes every anchor attribute, a `ref`, and Text’s type props. Use [Button](https://design-system.blocks-ui.com/components/button.md) for actions; use Link for navigation. ```tsx import { Link } from '@blocks/design-system' ``` ## Usage **Example: Links in a sentence** (`examples/link/inline.tsx`) ```tsx import { Body, Link } from '@blocks/design-system' export default function Inline() { return ( Readings come from the{' '} station network . Muted links work for secondary details: methodology. ) } ``` ## Router links Pass your router’s link component as `as` to keep client-side navigation and prefetching with the same styles. The package never imports a router: here `next/link` comes from the app. **Example: Related pages** (`examples/link/related-pages.tsx`) ```tsx import { Link, Stack } from '@blocks/design-system' import NextLink from 'next/link' export default function RelatedPages() { return ( {/* A native anchor: a full page load. */} Box, with a native link {/* next/link as the host: client-side navigation, same styles. */} Grid, with next/link ) } ``` ```tsx import { Link } from '@blocks/design-system' import NextLink from 'next/link' Grid ``` ## Props **`Link` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `color` | `"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| "accent-hover" \| "accent-fg" \| "accent-subtle" \| "accent-text" \| "danger" \| "danger-hover" \| "danger-fg" \| "danger-subtle" \| "danger-text" \| "warning" \| "warning-hover" \| "warning-fg" \| "warning-subtle" \| "warning-text" \| "success" \| "success-hover" \| "success-fg" \| "success-subtle" \| "success-text" \| "info" \| "info-hover" \| "info-fg" \| "info-subtle" \| "info-text" \| "text-muted"` | `accent-text` | A color token. Defaults to `"text"`. | | `fontFamily` | `"body" \| "heading" \| "monospace"` | — | A font token: `body`, `heading` or `monospace`. | | `fontSize` | `"body" \| "code" \| "heading" \| "xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| "xxxl" \| "xxxxl" \| "xxxxxl" \| "inherit"` | `inherit` | A font size token, e.g. `"sm"` or `"heading"`, or `"inherit"` to keep the parent's size. Defaults to `"body"`. | | `fontWeight` | `"body" \| "heading" \| "medium" \| "bold" \| "semibold"` | — | A font weight token: `body`, `medium`, `semibold`, `heading` or `bold`. | | `lineHeight` | `"body" \| "heading" \| "inherit"` | `inherit` | `body` or `heading`, or `"inherit"` to keep the parent's. Defaults to `"body"`. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches) and [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. ## Accessibility - Link text should make sense out of context, since screen readers can list a page’s links. Avoid “click here”. - The browser’s focus ring shows on keyboard focus; the optional reset draws it in the focus-ring color. - Don’t rely on color alone inside body text: the default underline keeps links distinguishable. ================================================================================ title: Card section: Components: Content url: https://design-system.blocks-ui.com/components/card markdown: https://design-system.blocks-ui.com/components/card.md ================================================================================ # Card Groups related content with a subtle border, rounded corners and `md` padding. Card is a Box, so it takes every Box prop, renders on the server and keeps `as`. The caller supplies the heading and the actions. ```tsx import { Card } from '@blocks/design-system' ``` ## Usage Put a heading and a native link or button inside the card. The card stays static; its link is the focus target, so keyboard and screen reader users meet one clear control per card. **Example: Station results** (`examples/card/station-results.tsx`) ```tsx import { BodySmall, Card, Grid, Heading, Link } from '@blocks/design-system' const results = [ { id: 'mount-hood', name: 'Mount Hood', detail: 'Oregon · 84 in of snow' }, { id: 'alta', name: 'Alta', detail: 'Utah · 102 in of snow' }, ] export default function StationResults() { return ( {results.map((result) => ( {result.name} {result.detail} {/* The card is static; its link is the one focus target. */} Open station ))} ) } ``` ## As an article Render a self-contained item `as="article"` and name it with its heading. **Example: Article card** (`examples/card/article-card.tsx`) ```tsx import { Body, Button, Card, Heading, Stack } from '@blocks/design-system' export default function ArticleCard() { return ( Storm cycle ending Snowfall tapers by Thursday; winds stay strong on exposed ridges. ) } ``` ## Borders and padding `borderColor`, `borderWidth` and `borderStyle` take tokens; `borderRadius` and the Box padding props override the defaults. **Example: Border options** (`examples/card/border-options.tsx`) ```tsx import { Body, Card, Stack } from '@blocks/design-system' export default function BorderOptions() { return ( Default Selected Drop files here ) } ``` ## Props **`Card` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `borderColor` | `"text" \| "overlay" \| "bg" \| "bg-subtle" \| "surface" \| "surface-hover" \| "surface-active" \| "selected" \| "border-subtle" \| "border" \| "border-strong" \| "focus-ring" \| "accent" \| "accent-hover" \| "accent-fg" \| "accent-subtle" \| "accent-text" \| "danger" \| "danger-hover" \| "danger-fg" \| "danger-subtle" \| "danger-text" \| "warning" \| "warning-hover" \| "warning-fg" \| "warning-subtle" \| "warning-text" \| "success" \| "success-hover" \| "success-fg" \| "success-subtle" \| "success-text" \| "info" \| "info-hover" \| "info-fg" \| "info-subtle" \| "info-text" \| "text-muted"` | `border-subtle` | A color token for the border, e.g. `"border"`. | | `borderRadius` | `"button" \| "circle" \| "sm" \| "md" \| "xl" \| "xxl" \| "xxxl" \| "none" \| "pill"` | `md` | A border radius token, e.g. `"md"`, `"pill"` or `"circle"`. | | `borderStyle` | `"none" \| "solid" \| "dashed" \| "dotted"` | `solid` | The border line style. | | `borderWidth` | `"sm" \| "md" \| "lg" \| "none"` | `sm` | A border width token: `none`, `sm`, `md` or `lg`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing) and [padding props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. ## Accessibility - Don’t make a whole card clickable with a handler on the container. Put a real link inside it, and give each card’s link a distinct name, as in “Open Alta”. - Lists of cards are lists: render them `as="ul"` with `as="li"` cards. ================================================================================ title: Badge and Spinner section: Components: Content url: https://design-system.blocks-ui.com/components/status markdown: https://design-system.blocks-ui.com/components/status.md ================================================================================ # Badge and Spinner Status feedback. `Badge` labels a state in a word or two; `Spinner` says something is in progress. Both render plain spans on the server. ```tsx import { Badge, Spinner } from '@blocks/design-system' ``` ## A pending task Pair a named Spinner with words. When the work finishes, replace both with a Badge that states the result, inside a `role="status"` region so screen readers announce the change. **Example: Sync a station** (`examples/status/sync-station.tsx`) ```tsx 'use client' import { Badge, Button, Spinner, Stack } from '@blocks/design-system' import { useState } from 'react' type State = 'idle' | 'syncing' | 'synced' export default function SyncStation() { const [state, setState] = useState('idle') function sync() { setState('syncing') // Stands in for a request; the docs journey controls the clock. setTimeout(() => setState('synced'), 1500) } return ( {state === 'syncing' && } {state === 'idle' && Not synced} {state === 'syncing' && Syncing} {state === 'synced' && Synced just now} ) } ``` ## Badge tones `tone` picks a semantic color: `neutral` (the default), `accent`, `info`, `success`, `warning` or `danger`. `variant="solid"` fills the badge for more emphasis. **Example: Tones** (`examples/status/badge-tones.tsx`) ```tsx import { Badge, Stack } from '@blocks/design-system' const tones = ['neutral', 'accent', 'info', 'success', 'warning', 'danger'] as const export default function BadgeTones() { return ( {tones.map((tone) => ( {tone} ))} {tones.map((tone) => ( {tone} ))} ) } ``` ## Spinner sizes `sm` and `md` match the icon sizes; `lg` matches a medium control. `label` names the status (“Loading” by default). Under reduced motion the spinner keeps turning, ten times slower, so it still reads as busy. **Example: Sizes** (`examples/status/spinner-sizes.tsx`) ```tsx import { Spinner, Stack } from '@blocks/design-system' export default function SpinnerSizes() { return ( ) } ``` ## Props **`Badge` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `tone` | `"accent" \| "danger" \| "warning" \| "success" \| "info" \| "neutral"` | `neutral` | The semantic color. Defaults to `"neutral"`. | | `variant` | `"subtle" \| "solid"` | `subtle` | `"subtle"` (default) tints the background; `"solid"` fills it. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`Spinner` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `label` | `string` | `Loading` | Announced to screen readers. Defaults to "Loading". | | `size` | `"sm" \| "md" \| "lg"` | `md` | `sm` and `md` match the icon sizes; `lg` matches a medium control. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. ## Accessibility - Color is never the only signal: a badge’s words carry the state, so “Synced” reads the same in grayscale. - Spinner is a `role="status"` region. Give it a specific `label` (“Syncing Mount Hood”) and remove it when the work ends. - Don’t put a Spinner inside a button’s label; disable the button and show the Spinner beside it. ================================================================================ title: Table section: Components: Content url: https://design-system.blocks-ui.com/components/table markdown: https://design-system.blocks-ui.com/components/table.md ================================================================================ # Table A semantic data table for rows of comparable values. The parts render the native ``, ``, ``, ``, `
` and `` elements, styled from the tokens. Each is a Box, so cells take Box props such as `textAlign`. Use Grid or Stack for layout, not Table. ```tsx import { Table, TableBody, TableCell, TableContainer, TableHead, TableHeader, TableRow } from '@blocks/design-system' ``` ## Usage Name the table with a native `
` as its first child. Give column headers `scope="col"`; when the first cell of each row identifies the row, make it a `TableHead` with `scope="row"`. Links inside cells stay ordinary links. **Example: Holdings** (`examples/table/holdings.tsx`) ```tsx import { Link, Table, TableBody, TableCell, TableContainer, TableHead, TableHeader, TableRow, } from '@blocks/design-system' const holdings = [ { symbol: 'VTI', name: 'Vanguard Total Stock Market ETF', shares: 120, price: '$291.40', value: '$34,968.00', change: '+0.8%' }, { symbol: 'VXUS', name: 'Vanguard Total International Stock ETF', shares: 210, price: '$66.12', value: '$13,885.20', change: '-0.3%' }, { symbol: 'BND', name: 'Vanguard Total Bond Market ETF', shares: 95, price: '$73.05', value: '$6,939.75', change: '+0.1%' }, ] export default function Holdings() { return ( Symbol Name Shares Price Value Today {holdings.map((holding) => ( {holding.symbol} {holding.name} {holding.shares} {holding.price} {holding.value} {holding.change} ))}
Holdings on December 1, 2026
) } ``` ## Wide tables `TableContainer` lets a table scroll sideways inside itself instead of widening the page on a narrow screen. Make it reachable by keyboard: `tabIndex={0}`, `role="region"` and `aria-labelledby` pointing at the caption, as above. ## Empty and loading states Keep the header row and put the message in a single cell that spans every column, so the table still says what it would hold. **Example: Empty watchlist** (`examples/table/empty-state.tsx`) ```tsx import { BodySmall, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@blocks/design-system' export default function EmptyState() { return ( Symbol Price No equities on your watchlist yet.
Watchlist
) } ``` ## Parts | Part | Element | | --- | --- | | `Table` | `` | | `TableContainer` | `
` that scrolls horizontally | | `TableHeader` | `
` | | `TableBody` | `` | | `TableRow` | `` | | `TableHead` | `
`, with `scope` | | `TableCell` | `` | ## Props **`Table` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), [padding props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`TableContainer` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), [padding props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`TableHeader` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), [padding props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`TableBody` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), [padding props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`TableRow` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), [padding props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`TableHead` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), [padding props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. **`TableCell` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | Also accepts [Box layout props](https://design-system.blocks-ui.com/components/box.md#props), [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches), [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), [padding props](https://design-system.blocks-ui.com/components/box.md#spacing) and [a ref](https://design-system.blocks-ui.com/components/box.md#refs), and the native attributes of the element it renders. ## Accessibility - A caption names the table for screen readers and everyone else; prefer it to a nearby heading. - `scope` tells assistive technology which cells a header describes. Without it, reading a cell gives no context. - Sorting controls belong in a button inside the header cell, not on the cell itself, so they are focusable and announced. ================================================================================ title: Button section: Components: Forms url: https://design-system.blocks-ui.com/components/button markdown: https://design-system.blocks-ui.com/components/button.md ================================================================================ # Button A native ` ) } ``` Give every button that shouldn’t submit an explicit `type="button"`, like this Cancel. **Example: Edit with cancel** (`examples/button/edit-with-cancel.tsx`) ```tsx 'use client' import { Box, Button, Stack } from '@blocks/design-system' import { type FormEvent, useState } from 'react' export default function EditWithCancel() { const [saved, setSaved] = useState({ name: 'Launch checklist', count: 0 }) const [draft, setDraft] = useState(saved.name) function save(event: FormEvent) { event.preventDefault() setSaved((previous) => ({ name: draft, count: previous.count + 1 })) } return ( Item name setDraft(event.target.value)} padding="xs" border="default" /> {/* An explicit type: a button in a form submits unless told otherwise. */}

Saved “{saved.name}” {saved.count} {saved.count === 1 ? 'time' : 'times'}

) } ``` ## Variants `primary` for the main action, `base` (the default) for the rest, `ghost` for low emphasis and `link` for an action that reads like text. **Example: Variants** (`examples/button/variants.tsx`) ```tsx import { Button, Stack } from '@blocks/design-system' export default function Variants() { return ( ) } ``` ## Sizes `sm`, `md` (the default) and `lg` follow the control-height tokens. **Example: Sizes** (`examples/button/sizes.tsx`) ```tsx import { Button, Stack } from '@blocks/design-system' export default function Sizes() { return ( ) } ``` ## Links that look like buttons `as="a"` renders an anchor with the button’s styles, as with “See all variants” above. It is still a link: Enter follows it, Space doesn’t. ## Disabled `disabled` on a button removes it from the tab order and blocks clicks. An anchor can’t be disabled; `aria-disabled="true"` styles it as unavailable, and the caller should leave out its `href`. **Example: Disabled** (`examples/button/disabled.tsx`) ```tsx import { Button, Stack } from '@blocks/design-system' export default function Disabled() { return ( ) } ``` ## Props **`Button` props** | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `ElementType` | — | The element or component to render, e.g. `as={NextLink}`. | | `borderRadius` | `"button" \| "circle" \| "sm" \| "md" \| "xl" \| "xxl" \| "xxxl" \| "none" \| "pill"` | `button` | A border radius token, e.g. `"md"`, `"pill"` or `"circle"`. | | `fontWeight` | `"body" \| "heading" \| "medium" \| "bold" \| "semibold"` | `semibold` | A font weight token: `body`, `medium`, `semibold`, `heading` or `bold`. | | `size` | `"sm" \| "md" \| "lg"` | `md` | `sm`, `md` or `lg`. Defaults to `"md"`. | | `variant` | `"base" \| "link" \| "primary" \| "ghost"` | `base` | `base`, `primary`, `ghost` or `link`. Defaults to `"base"`. | Also accepts [styling escape hatches](https://design-system.blocks-ui.com/components/box.md#escape-hatches) and [margin props](https://design-system.blocks-ui.com/components/box.md#spacing), and the native attributes of the element it renders. ## Accessibility - A button’s text is its name. An icon-only button needs an `aria-label`. - The focus ring is drawn by Button itself, so it stays visible without the global reset. - Don’t disable a submit button to show that a form is incomplete; let it submit and explain the error next to the field. ================================================================================ title: Label, Input and Textarea section: Components: Forms url: https://design-system.blocks-ui.com/components/inputs markdown: https://design-system.blocks-ui.com/components/inputs.md ================================================================================ # Label, Input and Textarea Native form controls in the design system’s style. They render real `