caliper uidocs

Docs template

Pro

Documentation at a reading measure, with an outline that follows you, slash search, linkable headings, copyable code and page feedback.

Installs components/ui/docs-template.tsxDepends on @radix-ui/react-slot, lucide-reactMotion none in component source
pnpm dlx shadcn@latest add @caliper/docs-template
Skip to content
Forma docs

Get started

Quickstart

Create a workspace, invite your team and send your first invoice in about ten minutes.

Install the CLI

The CLI signs you in, creates workspaces and sends test invoices. It needs Node 20 or later.

bash
npm install -g @forma/cli

Sign in

Run forma login. A browser window opens; approve the request and return to the terminal. The token is stored in your system keychain.

Create a workspace

Workspaces hold your customers, invoices and team. Most companies need one.

bash
forma workspace create "Forma Studio" --currency EUR

Choosing a currency

The currency is used for invoices and reports. You can bill customers in other currencies; reports convert at the day’s rate.

Next steps

Invite your team from the Team page, then connect your bank so payments match invoices on their own.

When to use #

Use it for

  • Product, API or help-centre documentation.
  • Long guides people read and come back to.

Skip it when

  • Marketing pages; use the landing template.

Installation #

terminal
pnpm dlx shadcn@latest add @caliper/docs-template

Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage #

Import it from your copy of the source. The example behind the preview comes with the source. It is built from DocsTemplate, DocsHeading and DocsCode.

example.tsx
import { DocsTemplate, DocsHeading, DocsCode } from "@/components/ui/docs-template"

The worked example comes with Pro

The 158-line example behind the preview opens here with a Pro or Team licence.

Checking your licence…

API reference #

DocsTemplate

component
PropTypeDefaultDescription
product *string—
linksreadonly { label: string; href: string; }[][]
sections *readonly DocsTemplateSection[]—
current *string—The id of the current page.
eyebrowstring—
title *string—
leadReactNode—
children *ReactNode—
previous{ title: string; href: string; }—
next{ title: string; href: string; }—
onSearch(() => void)—
onFeedback((helpful: boolean) => void)—
onNavigate((href: string) => void)—Called with the href of a page, previous/next or header link instead of following it, e.g. your router's push. Modified clicks still open normally.
editHrefstring—
classNamestring—

DocsHeading

component
PropTypeDefault
level2 | 32
id *string—
children *ReactNode—

DocsCode

component
PropTypeDefault
code *string—
languagestring—
labelstring—

Accessibility #

It exposes group and status semantics, with aria-label, aria-hidden, aria-current, aria-keyshortcuts, aria-expanded and aria-controls kept in step with state. Changes that matter are announced through a live region.

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.