Getting Started
From zero to styled components in two imports.
Installation
Install the core packages with your package manager. The tokens package provides CSS custom properties and atom styles. The core package provides React components.
pnpm add @toucan-ui/tokens @toucan-ui/coreTwo Imports
Every application starts with two imports: tokens (the visual foundation) and components (the structure).
// 1. Base tokens + atom CSS (ground zero)
import '@toucan-ui/tokens/css';
// 2. Components (structure + accessibility)
import { Button, Input, Box } from '@toucan-ui/core';Recommended App Globals
Toucan doesn't ship a CSS reset — that's your app's concern. We recommend adding these baseline styles to your global stylesheet:
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
font-family: var(--text-font-family);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}Toucan components work without these, but box-sizing: border-box and the token-based font family ensure consistent rendering across your entire app.
Your First Component
With the CSS imported, every component is automatically styled through the token cascade. No className wiring, no style props, no theme provider.
function App() {
return (
<Box padding="lg" radius="md" elevation={1}>
<Heading level={1}>Welcome</Heading>
<Text>Your design system is ready.</Text>
<Button variant="primary">Get started</Button>
</Box>
);
}Theming
Themes override tokens via a data-theme attribute on any ancestor element. See the Themes guide for details on creating custom themes.
What You Get
Next Steps
Explore the architecture to understand the three-thread model, browse the token reference, or dive into the component docs.