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.
bun add @blocks/design-system react react-dom
# or, for a release candidate:
bun add ./blocks-design-system-0.0.0.tgz react react-domImport the stylesheet once in your root layout, before your own CSS. Add the reset and Geist if you want them; both are optional.
// 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 resetThen 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.
Source · foundations/first-page.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 (
<Box as="article" aria-labelledby="first-station" data-ds-theme="dark" padding="lg" backgroundColor="bg" color="text">
<Heading as="h2" id="first-station">
Station
</Heading>
<Tabs defaultValue="summary">
<TabsList aria-label="Station views">
<TabsTab value="summary">Summary</TabsTab>
<TabsTab value="history">History</TabsTab>
</TabsList>
<TabsPanel value="summary">Current conditions</TabsPanel>
<TabsPanel value="history">Past observations</TabsPanel>
</Tabs>
</Box>
)
}From a Server Component, import compound parts by name (TabsList); in a 'use client' file you can also write Tabs.List. See Composition.
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.
@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.