Docs, pager


Install
npx shadcn add @klarhimmel/docs-pagerDetailsAbout, usage, props and more
Previous and next cards that close a documentation page, with optional actions (Copy for AI, Edit on GitHub) and a last-updated line. A card with no title is left out.
Import
Import
- docs/pager
- Category
- Documentation sections: headers, install panels, props tables, previews. New project? Set it up once: /get-started/installation.
Notes
When to use it
Closes a documentation page with previous and next cards, plus optional actions and a last-updated line. It does not list related content; for that use docs-related.
Writing for it
- Each step has a label of 20 characters, a title of 80 and a link. Make the title the name of the destination page, not a verb. - Actions take up to 3 links, drawn as ghost buttons; Copy for AI and Edit on GitHub are the typical pair. - The updated line holds 40 characters. Put a month and year in it, so a reader can judge how stale the page may be.
Watch out for
A step card with an empty title is not drawn at all. On the first page, leave prev blank and the next card stays on the right half of the grid, rather than jumping to the left.
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 |
|---|---|---|---|
prev | { label, title, href } | {…} | Fields: label, title, href. |
next | { label, title, href } | {…} | Fields: label, title, href. |
actions | Link[] | 2 items | List of up to 3. |
updated | string | 'Say when it was updated' | Text, up to 40 characters. |