Guides
Setup
Overview
- Available as a private npm package found at
@staffbase/design. - Built on React 18/19
- For styling it uses Tailwind v4
- Most compound components are built using Base UI primitives.
Requirements
- React 18 or 19 (
reactandreact-dom) — these are peer dependencies and aren’t bundled. - Tailwind v4 set up in your project. Follow the installation instructions from Tailwind.
Installation
Terminal
pnpm install @staffbase/design Configuration
CSS
@layer theme, base, components, utilities;
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/preflight.css' layer(base);
@import 'tailwindcss/utilities.css' layer(utilities);
@import '@staffbase/design/fonts/inter.css' layer(base);
@import '@staffbase/design/fonts/epilogue.css' layer(base);
@import '@staffbase/design/tokens/primitive.css' layer(base);
@import '@staffbase/design/tokens/semantic.css' layer(base);
@import '@staffbase/design/tokens/component.css' layer(base);
@import '@staffbase/design/components.css' layer(components);
@import '@staffbase/design/theme.css' layer(theme);
- Tailwind layers — the framework’s theme, preflight reset, and utilities.
- Fonts —
inter.cssandepilogue.cssregister the Staffbase typefaces (see Fonts below). - Token layers —
primitive,semantic, andcomponentexpose the design tokens as CSS custom properties. Prefer semantic tokens in your own code; they adapt to dark mode and theming. components.css— the bundled component styles. Always import this single file; never import per-component CSS.theme.css— the Tailwind v4 theme bridge that maps tokens onto Tailwind utilities.
HTML
<div class="text-neutral-strong p-1">Hello World</div> Fonts
CSS reset
Usage
TSX
import {Button} from '@staffbase/design'; TSX
<Button>Hello World</Button> Icons
TSX
import {CheckIcon} from '@staffbase/design'; Hooks
TSX
import {useFormatDateTime} from '@staffbase/design/hooks'; Editor support
VS Code
IntelliJ IDEA