Since this is a private npm package you will first need to set up your npm config so your package manager can authenticate against the registry.
Then install the design system:
Terminal
pnpm install @staffbase/spark
Configuration
Import the following into your application’s global stylesheet. The cascade layer order is declared up front so that rules in later layers override earlier ones — keep this order intact.
Tailwind layers — the framework’s theme, preflight reset, and utilities.
Fonts — inter.css and epilogue.css register the Staffbase typefaces (see Fonts below).
Token layers — primitive, semantic, and component expose 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.
illustrations.css — illustration styles. Only needed if your app uses @staffbase/spark/illustrations.
theme.css — the Tailwind v4 theme bridge that maps tokens onto Tailwind utilities.
Don’t use @apply for your CSS. We use @apply in Spark itself but this will soon be removed. See tailwind
docs for more information.
Fonts
The design system ships with copies of the Staffbase typefaces, Inter and Epilogue. These are registered by the @staffbase/spark/fonts/inter.css and @staffbase/spark/fonts/epilogue.css imports in the CSS block above, so you don’t need to preload or serve the font files separately.
CSS reset
Tailwind’s preflight.css (imported above) acts as the CSS reset, normalizing native browser styling to avoid conflicts with component styles. If your project already ships its own reset, keep the cascade layer order intact so design system styles win where expected.
Usage
Import the component you need directly from the package:
TSX
import {Button} from '@staffbase/spark';
And use it as you would any React component:
TSX
<Button>Hello World</Button>
Icons
Icon components are exported from the same entry point as components:
TSX
import {CheckIcon} from '@staffbase/spark';
Hooks
Hooks live behind a separate entry point:
TSX
import {useFormatDateTime} from '@staffbase/spark/hooks';
Editor support
VS Code
If you’re using VS Code, we recommend installing the Tailwind CSS IntelliSense extension. This provides code completion for Tailwind classes.
IntelliJ IDEA
If you’re using IntelliJ IDEA, there’s nothing you need to do. The IDE will automatically pick up the Tailwind classes and provide code completion.