Docs, table


Install
npx shadcn add @klarhimmel/docs-tableDetailsAbout, usage, props and more
A titled table with free columns (tokens, keyboard keys, variables, changelog). A column renders as text, code or badge; the first cell of each row is its header.
Import
Import
- docs/table
- Category
- Documentation sections: headers, install panels, props tables, previews. New project? Set it up once: /get-started/installation.
Notes
When to use it
A titled table with columns you define, such as keyboard keys, tokens, variables or a changelog. For component props use docs-props-table, which has the fixed columns.
Writing for it
- Choose 2 to 6 columns and give each a variant: text for prose, mono for code, badge for short labels. The first column becomes the row header. - Cells hold 160 characters and a row has up to 6 cells. Put the identifier in the first column, since it labels the whole row. - Add a note of 200 characters or an action link under the table for the thing a reader will ask next. The eyebrow holds 60.
Watch out for
A row with fewer cells than columns gets empty cells, and an empty badge cell is not drawn. The table scrolls sideways under 34rem, and mono cells never wrap.
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 |
|---|---|---|---|
eyebrow | string | 'Name the section' | Text, up to 60 characters. |
title | string | 'Say what the table lists' | Text, up to 80 characters. |
description | string | 'Say in a sentence what the rows hav…' | Text, up to 300 characters. |
columns | { label, variant }[] | 3 items | List of 2 to 6. Each item: label, variant ('text' | 'mono' | 'badge'). |
rows | { cells }[] | 4 items | List of 1 to 40. Each item: cells. |
action | Link | {…} | See the type. |
note | string | 'Say what to watch for beneath the t…' | Text, up to 200 characters. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |