Skip to content

Components

Every Docs Kit builder, documented one page per component with live previews.

Every component in the Docs Kit is a pure TypeScript function that returns an HTML string; interaction is attached at runtime by initCelestialUI() through data-cpd-* hooks. All exports come from src/lib/ui/index.ts.

Each page in this section documents one component: a live preview of its different states, the builder call that produced it, a props table and notes.

initCelestialUI() attaches all interactions via event delegation — call it once after the DOM is ready:

import { initCelestialUI } from '/src/lib/ui/runtime';
initCelestialUI();

It wires sidebar folders/collapse/drawer, ClerkTOC tracking, tabs, accordions, copy buttons and the theme toggle. It is idempotent and safe to call on any page (no-ops when no cpd- elements exist). On the docs site it is injected into every page by the celestialUiRuntime integration in astro.config.mjs.

See Styles for the design tokens and src/lib/ui/tokens.ts.