---
title: Components
description: 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.

## Runtime

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

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

It wires sidebar folders/collapse/drawer, Plumest TOC 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](/contribution/styles/) for the design tokens and
`src/lib/ui/tokens.ts`.
