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).
Install
Section titled “Install”pnpm add @protokit/ui @protokit/tokensImport the entries
Section titled “Import the entries”Import these once, at the app entry:
import '@protokit/tokens/css'; // custom properties, light + darkimport '@protokit/ui/fonts'; // self-hosted IBM Plex Sans (variable) and Plex Mono, optionalimport '@protokit/ui/styles.css'; // the components, inside @layer protoThe component styles ship inside @layer proto, so any unlayered CSS in your app wins without specificity fights.
Theme and density
Section titled “Theme and density”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.
Use a component
Section titled “Use a component”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.