Recolour a whole region with one CSS variable, pick a tone for a status, add a variant of your own with cva, or override a single class with className.
Recolour a region
Core components take their single highlight from --kn-accent and, on top of it, --kn-accent-foreground. Neither is set by default: the components fall back to --primary and --primary-foreground, so nothing changes until you set them. Set them on any element, a card, a section or :root, and everything inside follows. The Badge, Tag and Alert accent tone stay indigo until you do.
--kn-accent from this container.<section className="[--kn-accent:oklch(0.54_0.23_292)] [--kn-accent-foreground:oklch(0.985_0_0)]">
<Button>Deploy</Button>
<Progress label="Build" value={64} />
<Switch defaultChecked label="Notify me" />
</section>
/* or for the whole app, in your CSS */
:root { --kn-accent: oklch(0.54 0.23 292); --kn-accent-foreground: oklch(0.985 0 0); }
.dark { --kn-accent: oklch(0.72 0.17 292); }Tone
Components that show a status take tone: neutral, accent, success, warning or danger. Badge, Tag and Progress also have info. Each tone is correct in light and dark. accent follows --kn-accent; the others are fixed signal colours.
| Component | Prop | Values | Notes |
|---|---|---|---|
| Badge, Tag | tone | neutral, accent, info, success, warning, danger | Existing prop. accent reads --kn-accent. |
| Alert | tone | neutral, accent, info, success, warning, danger | The icon takes the tone; the surface stays a plain card. |
| Progress | tone | neutral, accent, info, success, warning, danger | neutral and accent both follow --kn-accent. |
| Status Dot | tone | neutral, accent, success, warning, danger | Wins over state for the colour; the pulse still follows state. |
| Segmented Control | tone | neutral, accent | accent fills the chosen segment. |
| Button, Switch, Checkbox | - | - | Follow --kn-accent with no prop. |
Add a variant of your own
Each core component exports its look as a class-variance-authority map: buttonVariants, progressVariants, alertVariants, statusDotVariants, switchVariants, checkboxVariants and segmentedThumbVariants. The files are yours after install, so add an entry and use it.
const VARIANT: Record<ButtonVariant, string> = {
primary: "...",
// your own
brand: "bg-fuchsia-600 text-white not-disabled:hover:bg-fuchsia-600/90",
};
export type ButtonVariant = "primary" | "secondary" | "ghost" | "destructive" | "quiet" | "brand";
<Button variant="brand">Upgrade</Button>
// on a link, without a Button
<a className={buttonVariants({ variant: "brand", size: "lg" })} href="/pricing">Upgrade</a>Override with className
cn in lib/knowns/utils.ts is clsx plus tailwind-merge, so a class you pass always beats the component’s own bg-*, text-*, rounded-* and p-*. Variants such as dark: and hover: are kept apart.
<Button className="rounded-full bg-emerald-600 px-5 text-white">Rounded and green</Button>Chart colours
Chart series take --chart-1 to --chart-5 and fall back to the built-in palette, so setting them on :root or on a container restyles every chart inside. See Theming for the full token list.