Purpose
This documentation site describes Checkatrade design tokens and React components shipped as npm packages. Use it as the source of truth for visual language, spacing, typography, and interactive patterns.
Packages
| Package | Role |
|---|---|
@checkatrade/tokens | CSS variables for colour, type, spacing, radii, and semantic aliases. |
@checkatrade/components-web | React components built with those tokens and Tailwind CSS v4. |
Consuming in an app
- Install dependencies and import token CSS once (globally), for example
import '@checkatrade/tokens/css'. - Configure Tailwind v4 with an
@themeblock that maps design utilities to the samevar(--…)names as Storybook and this site (see the Core section and your app’s Storybookglobals.css). - Import components from
@checkatrade/components-weband pass props as documented on each component page. - On Next.js App Router, list
@checkatrade/components-webintranspilePackagesinnext.configso the package’s TypeScript source and its'use client'directives are compiled. Interactive components (Button, TextInput, Modal, the control components, and the rest) are client components, so they can be imported straight into a server component.Surface,Badge,Divider,RatingDisplay,CheckatradeLogo,Text,IconandCardcarry no directive and render on the server as well, so a content page with no interactive components ships only Surface’s tone provider, about 200 bytes gzipped.
Contributing
Add or change tokens in the tokens package, then update consumer @theme maps. Add components in packages/web, export them from the package entry, and document them here with a page under Components and an entry in the sidebar navigation config.