Skip to content

Getting started

The system is two npm packages: @protokit/tokens (CSS custom properties, Sass, TypeScript and JSON from one Style Dictionary source) and @protokit/ui (React 19 components on Base UI).

Terminal window
pnpm add @protokit/ui @protokit/tokens

Import these once, at the app entry:

import '@protokit/tokens/css'; // custom properties, light + dark
import '@protokit/ui/fonts'; // self-hosted IBM Plex Sans (variable) and Plex Mono, optional
import '@protokit/ui/styles.css'; // the components, inside @layer proto

The component styles ship inside @layer proto, so any unlayered CSS in your app wins without specificity fights.

Set data-theme="light" or data-theme="dark" on <html>. With no attribute, the tokens follow prefers-color-scheme. Set data-density="compact" on any ancestor for the compact sizes. This site uses the same attribute: the theme switcher in the header flips it.

import { Button } from '@protokit/ui';
export function Save() {
return <Button variant="primary">Save</Button>;
}

Every component and state is in the workshop; the package README on GitHub documents each prop.