Copybook
Components

Overview

shadcn components that render definitions, installed with shadcn add.

The components are distributed as a shadcn registry. You own the code, so restyle it to match your product.

Each component takes a Rendered tree, not a definition. Call render() on the server and pass the result to the component. Only the variants you show reach the browser, and the tree is plain JSON.

ComponentUse it for
Agent PromptA prompt to paste into a coding agent
Code VariantsOne snippet in several frameworks or setups
Command TabsA command per package manager, with an optional prompt tab

Every component:

  • highlights params, and shows secret placeholders differently from real values;
  • sets data-copybook-id (and data-copybook-variant) on its root, so you can find definitions on a live page;
  • calls onCopy({ id, variant, text }) after a copy, for analytics;
  • depends only on shadcn's button, tabs, and utils, plus @copybook/core.