Components
Prose
Spacing, a readable measure and quiet links for long-form markup you do not control, such as a Markdown render, release notes or a legal page.
pnpm dlx shadcn@latest add @caliper/proseWhen to use
Use it for
- Rendered Markdown, CMS content and release notes.
- Docs that carry headings, lists, quotes and code together.
Skip it when
- Interface text; style it with the type scale directly.
- Marketing pages with their own layout; use the blocks.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Styling
- Product 14/22 and reading 17/1.7
- Product size matches the interface around it; reading size is the article template's, for pages people sit with.
- Links stay underlined
- Colour is never the only cue, and the underline thickens on hover so the target is clear without changing the text colour.
Installation
pnpm dlx shadcn@latest add @caliper/prose
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
This is the code behind the preview above.
import { useState, type ReactNode } from "react" import { cn } from "@/components/ui/lib/cn" import { Prose } from "@/components/ui/prose" import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle" function Panel({ title, context, children, className }: { title: ReactNode; context: ReactNode; children: ReactNode; className?: string }) { return ( <section className={cn("grid w-full max-w-md gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting", className)}> <div className="grid gap-1"> {/* div, not p: titles here can hold a badge or a direction-aware block. */} <div className="font-medium">{title}</div> <p className="text-sm text-muted-foreground">{context}</p> </div> {children} </section> ); } export function ProseDemo() { const [size, setSize] = useState(["product"]); return ( <Panel title={<span className="flex flex-wrap items-center justify-between gap-3">Changelog<ToggleGroup type="single" label="Text size" value={size} onValueChange={setSize}> <ToggleGroupItem value="product" size="sm">Product</ToggleGroupItem> <ToggleGroupItem value="reading" size="sm">Reading</ToggleGroupItem> </ToggleGroup></span>} context="Rendered from Markdown · published by Elias Kim" className="max-w-2xl" > <Prose size={size[0] === "reading" ? "reading" : "product"}> <h1>Release notes, October 2026</h1> <p>Eleven parts shipped, and every dialog now returns focus to where you were.</p> <h2>What changed</h2> <p>The <a href="#changes">toggle group</a> moves with the arrow keys and is one tab stop. Install it with <code>npx shadcn add @caliper/toggle</code>.</p> <h3>Upgrade notes</h3> <ul> <li>Dialog actions are ordered cancel first, then the action</li> <li>No breaking changes to props</li> </ul> <blockquote>We replaced the hand-rolled confirm in three places and deleted 400 lines.</blockquote> </Prose> </Panel> ); }
API reference
Prose
component
Also accepts the native props of its root element and a ref.
Accessibility
It is built on native elements, so roles and focus come from the browser.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- Data tableAccessible table markup with consistent cell styling and a scrollable region.
- Description listA record's details as label and value pairs, side by side when there is room, with copy and edit where the value sits.
- QR codeA QR code drawn as one crisp SVG path, encoded in the file with no dependency and no request. It stays dark on a white plate in both themes, keeps the quiet zone scanners need, and says what it is for to assistive technology.