Docs, anatomy


Install
npx shadcn add @klarhimmel/docs-anatomyDetailsAbout, usage, props and more
A diagram or live demo beside the part tree and part list of a compound component.
Import
Import
- docs/anatomy
- Category
- Documentation sections: headers, install panels, props tables, previews. New project? Set it up once: /get-started/installation.
Notes
When to use it
Shows how a compound component is built: a diagram or live demo on one side, the part tree and a list of part names on the other. When one setup or one set of variants is the point, docs-examples or docs-preview-frame fits better.
Writing for it
- The tree is a code panel of up to 600 characters, so list each part once with its nesting and leave props out; the parts list below carries the explanation. - Each part has a name of 40 characters and a description of 160. Start the description with what the part does, for example where it sits or what it groups. - Fill the demo field with a registered demo id when you have one. It wins over the preview image, and the image alt text should name the labelled parts.
Watch out for
The parts list allows 12 entries and is drawn only when it has at least one, outside the editor. The name column is a fixed 10rem wide on wider containers, so a long compound name wraps inside it instead of widening the column.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | 'Name this part' | Text, up to 60 characters. |
description | string | 'Say in a sentence how the parts fit…' | Text, up to 200 characters. |
preview | Media | {…} | Optional; empty is not rendered. |
demo | string | 'card-basic' | Text, up to 80 characters. Optional; empty is not rendered. |
tree | string | '<Root>
<Header>
<Title />
…' | Text, up to 600 characters. |
parts | { name, description }[] | 6 items | List of up to 12. Each item: name, description. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |