Skip to content
caliper ui docs

Pro

Docs template

Documentation for a developer product: guides with steps and tabbed code, API pages with parameters and live samples, webhooks, errors and rate limits, SDKs and recipes, a changelog, and slash search over all of it.

Pro
pnpm dlx shadcn@latest add @caliper/docs-template
Skip to content
Forma docs

Get started

Quickstart

Create a workspace, get a test key and send your first invoice in about ten minutes.

You need a Forma account and Node 20 or later for the CLI. The API itself works from any language; the examples show curl, Node and Python.

Install the CLI

The CLI signs you in, creates workspaces and keys, and forwards webhook events to your machine while you build.

npm install -g @forma/cli

Send your first invoice

  1. 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.

    bash
    forma login
  2. Create a workspace

    A workspace holds your customers, invoices and team. Most companies need one. The currency is the default for new invoices; you can bill in others.

    bash
    forma workspace create "Forma Studio" --currency EUR
  3. Create a test key

    Keys belong to a workspace, not a person. A test key starts with fk_test_ and only sees test data.

    bash
    forma keys create --name "Local development" --mode test
  4. Create a customer

    Every invoice belongs to a customer. The customer's payment terms set the due date.

    bash
    forma customers create \  --name "Palisade Hotels Group" \  --email accounts@palisade.example \  --terms net30

Create the invoice

With a customer and a key you can call the API. Replace cus_8Kq2mZ with the id the previous step printed.

curl https://api.forma.example/v2/invoices \  -H "Authorization: Bearer $FORMA_KEY" \  -H "Idempotency-Key: first-invoice-001" \  -d customer=cus_8Kq2mZ \  -d "lines[0][description]=Brand identity workshop" \  -d "lines[0][unit_amount]=480000" \  -d send=true

Listen for events

When the customer pays, Forma sends an invoice.paid event. During development the CLI forwards events from Forma to a port on your machine.

bash
forma listen --forward-to localhost:4242/forma/hooks

Trigger a test payment from the dashboard or with forma trigger invoice.paid and watch the event arrive. Webhooks explains the payload and how to verify that an event really came from Forma.

Go live

  1. Create a live key with forma keys create --mode live and store it in your secrets manager, not in your repository.
  2. Add a live webhook endpoint with its own signing secret.
  3. Check Errors and rate limits so your code retries the right failures.
  4. Switch your client from the test key to the live key. Nothing else changes.

Installs components/ui/docs-template.tsxDepends on @radix-ui/react-dialog, @radix-ui/react-slot, lucide-reactMotion shared motion tokens

When to use

Use it for

  • Product, API or SDK documentation with reference pages next to guides.
  • Long reading that people search, link into and come back to.
  • A large site on a router: put DocsLayout in the shared layout and a DocsPage in each page, so the sidebar keeps its scroll, filter and folded sections.

Skip it when

  • Marketing pages; use the landing template.
  • A handful of help articles; a knowledge base is lighter.

Installation

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

Adds its 13 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

example.tsx
import { DocsTemplate, DocsLayout, DocsPage, DocsHeading, DocsCode, DocsCodeGroup, DocsCallout, DocsSteps, DocsStep, DocsTable, DocsCards, DocsFilter, DocsToolbar, DocsEmpty, DocsHits, DocsRelease, DocsEndpoint, DocsParams, DocsPanes, DocsResponse, DocsSearch, searchDocs, searchExcerpt, highlightMatches } from "@/components/ui/docs-template"

The worked example comes with Pro

The 1275-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

DocsTemplate

component
PropTypeDefaultDescription
filterboolean—A field above the pages that filters them by title.
classNamestring—
product *ReactNode—The product name, or its logo.
homeHrefstring—Makes the product name a link, usually to the docs or site home.
linksreadonly DocsTemplateLink[]—
sections *readonly DocsTemplateSection[]—
current *string—The id of the current page.
onSearch(() => 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.
headerEndReactNode—Controls at the end of the header, such as a version switcher. Under 560px they move into the Menu panel.
menuEndReactNode—What the Menu panel shows instead of a second copy of `headerEnd`, for controls that should not mount twice.
onFilterChange((query: string) => void)—Reports the filter text, so you can pass more sections while it is set, such as every area of a large site.
asideReactNode—Under the outline in the right column, such as a related link or a short promotion. It is not shown where the outline folds.
title *string—
children *ReactNode—
next{ title: string; href: string; }—
previous{ title: string; href: string; }—
eyebrowstring—
leadReactNode—
actionsReactNode—Under the lead: an install command, copy and open buttons, or badges.
onFeedback((helpful: boolean) => void)—
editHrefstring—
noticeReactNode—A banner above the title, such as "You are reading the v1 docs".
layout"reading" | "reference"—

DocsLayout

component
PropTypeDefaultDescription
product *ReactNode—The product name, or its logo.
homeHrefstring—Makes the product name a link, usually to the docs or site home.
linksreadonly DocsTemplateLink[][]
sections *readonly DocsTemplateSection[]—
current *string—The id of the current page.
onSearch(() => 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.
headerEndReactNode—Controls at the end of the header, such as a version switcher. Under 560px they move into the Menu panel.
menuEndReactNode—What the Menu panel shows instead of a second copy of `headerEnd`, for controls that should not mount twice.
filterbooleanfalseA field above the pages that filters them by title.
onFilterChange((query: string) => void)—Reports the filter text, so you can pass more sections while it is set, such as every area of a large site.
classNamestring—
children *ReactNode—One `DocsPage`.

DocsPage

component
PropTypeDefaultDescription
current *string—The id of the page on show, the same `current` the layout gets.
eyebrowstring—
title *string—
leadReactNode—
actionsReactNode—Under the lead: an install command, copy and open buttons, or badges.
children *ReactNode—
previous{ title: string; href: string; }—
next{ title: string; href: string; }—
onFeedback((helpful: boolean) => void)—
editHrefstring—
noticeReactNode—A banner above the title, such as "You are reading the v1 docs".
asideReactNode—Under the outline in the right column, such as a related link or a short promotion. It is not shown where the outline folds.
layout"reading" | "reference""reading"

DocsHeading

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

DocsCode

component
PropTypeDefault
code *string—
languagestring—
labelstring—

DocsCodeGroup

component
PropTypeDefaultDescription
samples *readonly DocsCodeSample[]—
valuestring—
onValueChange((id: string) => void)—
label *string—Names the group for screen readers, e.g. "Install".
titlestring—A caption above the tabs, e.g. "Request".

DocsCallout

component
PropTypeDefault
kind"warning" | "note" | "danger" | "tip""note"
titlestring—
actionsReactNode—
children *ReactNode—

DocsSteps

component
PropTypeDefault
children *ReactNode—

DocsStep

component
PropTypeDefault
title *string—
childrenReactNode—

DocsTable

component
PropTypeDefault
caption *string—
children *ReactNode—

DocsCards

component
PropTypeDefault
items *readonly DocsCardItem[]—
onNavigate((href: string) => void)—

DocsFilter

component
PropTypeDefault
label *string—
value *string—
onValueChange *(value: string) => void—
options *readonly DocsFilterOption[]—

DocsToolbar

component
PropTypeDefault
countReactNode—
children *ReactNode—

DocsEmpty

component
PropTypeDefault
title *string—
actionReactNode—
childrenReactNode—

DocsHits

component
PropTypeDefault
hits *readonly DocsHit[]—
onNavigate((href: string) => void)—

DocsRelease

component
PropTypeDefault
id *string—
title *string—
date *string—
dateLabel *string—
version *string—
tagsReactNode—
children *ReactNode—

DocsEndpoint

component
PropTypeDefault
method *DocsMethod—
baseUrl *string—
path *string—
childrenReactNode—

DocsParams

component
PropTypeDefault
params *readonly DocsParam[]—
label *string—
responsebooleanfalse

DocsPanes

component
PropTypeDefault
aside *ReactNode—
children *ReactNode—

DocsResponse

component
PropTypeDefault
responses *readonly DocsResponseSample[]—
titlestring"Response"

DocsSearch

component
PropTypeDefaultDescription
open *boolean—
onOpenChange *(open: boolean) => void—
entries *readonly DocsSearchEntry[]—
onOpen *(entry: DocsSearchEntry) => void—Called with the chosen entry after the dialog has closed.
onSeeAll((query: string, section: string) => void)—Adds a "See all results" action that hands over the query and section.
recent *readonly string[]—
onRecentChange *(recent: string[]) => void—
suggestionsreadonly string[][]Shown before typing and when nothing matches.
status"loading" | "error" | "ready""ready"
onRetry(() => void)—
limitnumber8

searchDocs

component

No props of its own; it accepts the native props of its root element.

searchExcerpt

component

No props of its own; it accepts the native props of its root element.

highlightMatches

component

No props of its own; it accepts the native props of its root element.

Accessibility

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

Keyboard and focus handling comes from Radix dialog: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.

Motion

Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.

All Pages examples