Getting started
Add Slant to a project, load the stylesheet, and render your first component.
Demo
Usage
// 1. Load the stylesheet once, anywhere above your app.
import '@tuttn/slant/styles.css'
import { Slant, Button, Stack, Text } from '@tuttn/slant'
// 2. Wrap your tree in a themed root. Sage is the default theme.
export function App() {
return <Slant theme="sage">
<Stack>
<Text variant="title">Hello, Slant</Text>
<Button variant="primary">Deploy</Button>
</Stack>
</Slant>
}Slant ships as ES modules with TypeScript types and a single stylesheet. React 18 or 19 is the only peer dependency; there is no icon library or CSS-in-JS runtime to add.
Inside this repository the package is an npm workspace at slant/react. The site consumes its source through a Vite alias, so edits hot-reload; a published install uses the built dist/ output instead, which npm run build:slant produces.
Every component reads the --sl-* tokens of the nearest .slant root, so nesting roots themes a subtree. The Theming page covers the four themes, direction, density and how to add a theme; Conventions covers what every component shares.
The stylesheet sits in @layer slant, so any unlayered rule of yours overrides it. If your app resets elements globally (button { color: inherit }), put those resets in a layer declared first, @layer base, slant;, or they restyle Slant's controls too.
No build step? The whole stylesheet is hosted at /kit/slant.css: link it, wrap your markup in <div class="slant" data-theme="moon">, and use the sl-* classes the components render. The tokens are also served as /kit/tokens.json.