Add the package
The kit ships as a single ESM package. Install with the package manager of your choice.
terminalbash
npm install @pxlkit/ui-kit# orpnpm add @pxlkit/ui-kit# oryarn add @pxlkit/ui-kitA versatile button component. Surface-aware, tone-driven, and keyboard-ready out of the box.
The kit ships as a single ESM package. Install with the package manager of your choice.
npm install @pxlkit/ui-kit# orpnpm add @pxlkit/ui-kit# oryarn add @pxlkit/ui-kitA primary button is the default. Use it for the main action on a page.
import { PixelButton } from '@pxlkit/ui-kit';export function Example() { return <PixelButton>Press Start</PixelButton>;}Map intent to a semantic tone — gold for high-stakes confirms, red for destructive paths.
<PixelButton tone="gold">Continue</PixelButton><PixelButton tone="red">Delete</PixelButton>Three sizes cover most surfaces — compact toolbars, default forms, and oversized hero CTAs.
<PixelButton size="sm">Small</PixelButton><PixelButton size="md">Medium</PixelButton><PixelButton size="lg">Large</PixelButton>tone | "cyan" | "gold" | "red" | "purple" | "green" | "neutral" | "cyan" | Semantic color intent. Drives background, border, and text token. |
size | "sm" | "md" | "lg" | "md" | Controls horizontal/vertical padding and label font size. |
variant | "solid" | "outline" | "ghost" | "solid" | Fill style. Use ghost inside tight toolbars to reduce visual weight. |
disabled | boolean | false | Visually mutes the button and blocks pointer + keyboard activation. |
onClick | (event: MouseEvent) => void | — | Fired on click and on Enter/Space when the button has focus. |
WAI-ARIA Authoring Practices
Renders a native <button>, so Enter/Space activate it without extra wiring. focus-visible ring is on by default. Pair tone-driven colors with text labels — color alone never carries meaning.