Docs, customise panel


Install
npx shadcn add @klarhimmel/docs-customiseDetailsAbout, usage, props and more
The component-page customise panel: a stage and its code beside a list of controls (select, toggle, text). The layout is static; the site wires the controls to the code.
Import
Import
- docs/customise
- Category
- Documentation sections: headers, install panels, props tables, previews. New project? Set it up once: /get-started/installation.
Notes
When to use it
A component page panel where a stage and its code sit beside a column of controls, so a reader sees which settings exist. It is a static layout; for a plain stage with code and no controls use docs-preview-frame.
Writing for it
- Each control has a variant: select, toggle or text. A select needs its options (up to 6, 30 characters each) and its value must match one of them to be marked as current. - A toggle reads its value as on, true or yes to start switched on; anything else starts off. Write the value as the word the reader would expect beside the switch. - The code field holds 600 characters and the filename 60. Show the default state, because the controls are labels and the code does not change when they are used.
Watch out for
The block itself never rewrites the code or the stage; the site has to wire that. The reset button is drawn disabled and dimmed, so do not promise in the description that it works on the published page unless the host connects it.
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 the panel' | Text, up to 60 characters. |
description | string | 'Say what changing a setting does he…' | Text, up to 200 characters. |
preview | Media | {…} | Optional; empty is not rendered. |
demo | string | 'button-primary' | Text, up to 80 characters. Optional; empty is not rendered. |
filename | string | 'your-file.tsx' | Text, up to 60 characters. |
code | string | '<Component option="first" size="md"…' | Text, up to 600 characters. |
reset | string | 'Reset' | Text, up to 20 characters. |
controls | { label, variant, value, options }[] | 5 items | List of up to 8. Each item: label, variant ('select' | 'toggle' | 'text'), value, options. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |