About this template
A one-page, three-column API reference for a fictional JSON API: a sticky left navigation of endpoint groups with an instant search box (client-side, keyboard-navigable); a center reading column with a getting-started block (base URL, one install command with copy button, three quickstart steps) and eight endpoint blocks — method chips, paths, descriptions, parameter tables (name, type, required, default, description), code samples with curl/JS/Python tabs and working copy buttons, and response examples with status chips and collapsible JSON; and a right-hand on-this-page anchor rail. The default documents an invented expenses API, but the structure suits any REST API. The look is studio light: paper ground, ink text, one signal-blue accent, hand-highlighted code in dark panels — no highlighter library, no network calls. All content lives in one typed file; swapping the variables rewrites every command, URL and sample from the brand slug.
The template prompt
The live demo was built from exactly this text — nothing added.
# API Reference Docs Site
Build this website exactly as described below. Replace the [VARIABLES] with your own values; keep everything else.
## Brief
A one-page API reference for [BRAND], the JSON API for [PRODUCT], at version [VERSION]. Three columns: endpoint navigation with instant search, a reading column with a getting-started block and eight endpoint blocks (parameters, tabbed code samples with copy, response examples), and an on-this-page rail. One page, index.html; search, tabs, copy and collapse all run in the browser.
- Audience: A developer pasting their first request within five minutes: they want the base URL, an API-key line, honest parameter tables and copy-paste samples that actually match the schema.
- Goal: First successful call fast. Within ten seconds the visitor sees the base URL and install command; within two minutes they have copied a curl sample and found the endpoint they came for via search.
- Tone: Documentation-plain: short declarative sentences, no marketing voice, one dry joke in the errors block.
## Stack
- Framework: Vite 5 + React 18 + TypeScript
- Styling: Tailwind CSS 3.4
- Libraries: react (MIT), react-dom (MIT), motion (motion.dev, import from 'motion/react') (MIT), lucide-react (ISC), tailwindcss (MIT), postcss (MIT), autoprefixer (MIT), vite (MIT), @vitejs/plugin-react (MIT), typescript (Apache-2.0), @fontsource-variable/ibm-plex-sans (OFL-1.1), @fontsource/ibm-plex-mono (OFL-1.1)
- Build: `npm run build` → static files in `dist/`. No backend, no server code, no external APIs.
- Setup:
- Scaffold with npm create vite@latest using the react-ts template (pin the version if the latest template targets newer majors), then keep one real HTML page: index.html (entry src/main.tsx).
- vite.config.ts: base './', plugins [react()], build { outDir 'dist', sourcemap false, assetsInlineLimit 0 }. Do not copy src/ into dist/.
- Tailwind 3.4 through PostCSS, content ['./index.html', './src/**/*.{ts,tsx}']. In tailwind.config.ts add every color under Design to theme.extend.colors with kebab-case keys (paper, panel, line, ink, softink, blue, blue-deep, blue-mist, get, post, patch, del, codebg, codetext, codestring, codekey, codecomment) and fontFamily sans ['IBM Plex Sans Variable', 'system-ui', 'sans-serif'], mono ['IBM Plex Mono', 'ui-monospace', 'monospace']. Set borderRadius DEFAULT to 8px and add maxWidth { container: '1440px', read: '760px' }.
- In src/fonts.ts import '@fontsource-variable/ibm-plex-sans' and '@fontsource/ibm-plex-mono/400.css' plus '500.css' and '600.css'; import src/fonts.ts and src/index.css from the entry file.
- File layout: src/content.ts (every string, endpoint, parameter row, code line, response and error, typed — endpoints: { id, group, method, path, title, desc, params: { name, type, required, default, desc }[], samples: { curl, js, py }, response: { status, body }[] }), src/lib/brand.ts (brandSlug = [BRAND] lowercased with every run of non-alphanumeric characters replaced by '-', baseUrl = 'https://api.' + brandSlug without hyphens + '.dev/' + [VERSION], npmPackage = '@' + brandSlug without hyphens + '/client', keyHeader = 'Authorization: Bearer ' + brandSlug.toUpperCase() without hyphens + '_KEY'). Every URL, package name and command in content.ts is built from these helpers — nothing hard-codes the brand.
- src/lib/search.ts (score(query, endpoint) matching against title, path, group, param names and descriptions; returns ranked ids), src/lib/clipboard.ts (copy(text) using navigator.clipboard with a textarea fallback).
- State: src/store/docs.ts is a tiny external store (useSyncExternalStore) holding { query, activeEndpoint, copiedKey } — no persistence needed; search state resets on load.
- Components in src/components/: Header.tsx (with the inline SearchBox.tsx), EndpointNav.tsx (NavGroup.tsx, NavItem.tsx), OnThisPage.tsx (AnchorRow.tsx), GettingStarted.tsx (InstallLine.tsx with CopyButton.tsx), EndpointBlock.tsx (MethodChip.tsx, PathLine.tsx, ParamTable.tsx, CodeTabs.tsx with TabButton.tsx and CopyButton.tsx, ResponseBlock.tsx with StatusChip.tsx and JsonView.tsx), ErrorsBlock.tsx, Footer.tsx. src/pages/Docs.tsx composes them.
- CodeTabs: three tab buttons (curl / JavaScript / Python), roving tabindex with arrow keys, panels swapped with a 160ms crossfade; the CopyButton copies the active tab's raw text (kept in a hidden string, not scraped from the DOM) and shows a Check icon for 1.2s.
- Syntax highlighting is hand-rolled: samples are stored as plain strings and rendered by a tiny tokenizer in src/lib/highlight.ts (regex spans for strings, numbers, keys, comments and flags) into colored spans — no highlighter dependency.
- JsonView: pre-styled pretty JSON with the same tokenizer; a response header row carries StatusChip(s) (200 / 400) and a collapse toggle (rotating chevron) that animates max-height 240ms.
- Search: typing in the SearchBox filters the left nav live (non-matching items dim to 30% and sink), Enter focuses the first match's block, Escape clears; with an active query, non-matching EndpointBlocks in the reading column fade to 25% and a sticky 'N results · clear' bar shows above the column. All client-side.
- public/favicon.svg as described under Assets. index.html: lang en, <meta name='theme-color' content='#FAFAF8'>, <link rel='icon' href='./favicon.svg' type='image/svg+xml'>, <title>[BRAND] API — [VERSION] reference</title>.
- Write ASSETS.md at the project root as described under Assets.
- dist/ holds index.html, hashed JS/CSS, the woff2 fonts and favicon.svg. Keep it under 4 MB.
## Variables
- [BRAND] — API name (default: "Ledgerline"). The invented API's name, one word. Drives the wordmark, title, base URL (api.<brand>.dev), npm package (@<brand>/client), key header and every sample command. Never a real API.
- [PRODUCT] — What it serves (default: "expense data for small teams"). One lowercase phrase naming the domain. Rewrites the getting-started copy, group descriptions and endpoint one-liners. Keep it concrete.
- [VERSION] — API version (default: "v1"). The path prefix and version chip, like 'v1'. Keeps every sample URL consistent; no dates.
- [CREDIT] — keep a small "Template by VibeFather" link to https://vibefather.ai/t/api-reference-docs-site in the footer (default: yes; delete this line to remove it)
The copy under Pages & Sections is written for the default values. If your values differ, rewrite every headline, paragraph, label and image for them — same length, tone and structure. Layout, colors, type and motion stay as described.
Keep all copy, image paths and links in one content file (for example `src/content.ts`), keyed by section, so the content can be swapped later without touching components.Pro template. The design, sections, motion and assets parts of this prompt are for Pro members. The live demo and DESIGN.md stay free.
Join Pro early access →DESIGN.md
The design system on its own — colors, type, spacing and motion. Apply this look to a project you already have.
---
name: "API Reference Docs Site"
colors:
paper: "#FAFAF8"
panel: "#FFFFFF"
line: "#E4E2DC"
ink: "#1B1F24"
soft_ink: "#61666D"
signal_blue: "#2E5BFF"
blue_deep: "#1F41C4"
blue_mist: "#EDF1FF"
get: "#157F4C"
post: "#2E5BFF"
patch: "#8A5CF6"
delete: "#C24040"
code_bg: "#14171C"
code_text: "#E8EAF0"
code_string: "#9DCE8C"
code_key: "#8FB5FF"
code_comment: "#6B7280"
typography:
text_and_display_h1_h2_nav_body_tables_ibm_plex_sans_neutral_with_personality_at_600: { family: "IBM Plex Sans", weights: [400, 500, 600] }
mono_paths_code_json_params_chips_ibm_plex_mono: { family: "IBM Plex Mono", weights: [400, 500] }
spacing: "8px base unit. Page: a 1440px container split into three columns — left nav 264px, center reading column max 760px, right rail 200px, gaps 40px; under 1100px the right rail hides; under 900px the nav collapses into a top drawer (hamburger in the header) and the reading column takes full width with 24px side padding. Section vertical rhythm 56px between endpoint blocks. Type scale: H1 (getting-started title) 36px Plex Sans 600; group headings 22px 600 with mono group slugs; endpoint titles 26px 600; body 15.5px / 1.7; descriptions 15px / 1.65 Soft Ink; eyebrow 12px 600 uppercase letter-spacing 0.14em Soft Ink; code and paths 13.5px / 1.65 Plex Mono; table text 14px. Buttons and inputs: height 40px; search input full nav width. Focus everywhere: 2px Signal Blue outline, 3px offset."
radius: "8px on code panels, tables, chips, search input, buttons. 6px on method chips and status chips (with 2px letter-spaced 10.5px labels)."
---
# API Reference Docs Site — Design System
Apply this design system to an existing project. It describes the look and feel only; for the full site, use prompt.md.
## Colors
- **Paper** `#FAFAF8` — Page background throughout.
- **Panel** `#FFFFFF` — Tables, nav, code panels sit on Paper; panels for hover and the search bar.
- **Line** `#E4E2DC` — 1px hairlines: column rules, table rows, borders, the sticky header underline.
- **Ink** `#1B1F24` — Headings, body, code path text.
- **Soft Ink** `#61666D` — Descriptions, captions, table defaults, eyebrows.
- **Signal Blue** `#2E5BFF` — The one accent: links, active nav item, focus ring, required asterisks, the version chip border.
- **Blue Deep** `#1F41C4` — Hover and pressed links.
- **Blue Mist** `#EDF1FF` — Active nav fill, selected tab underline wash, search highlight in nav.
- **GET** `#157F4C` — GET method chip fill and its PathLine method tag.
- **POST** `#2E5BFF` — POST method chip fill.
- **PATCH** `#8A5CF6` — PATCH method chip fill.
- **DELETE** `#C24040` — DELETE method chip fill and error status chips.
- **Code BG** `#14171C` — Code and JSON panel background.
- **Code Text** `#E8EAF0` — Default code text.
- **Code String** `#9DCE8C` — Strings and URLs in code.
- **Code Key** `#8FB5FF` — JSON keys and flags in code.
- **Code Comment** `#6B7280` — Comments and sample-value hints in code.
## Typography
- **Text and display: H1, H2, nav, body, tables — IBM Plex Sans, neutral with personality at 600** — IBM Plex Sans (OFL), weights 400/500/600. Self-host the font files.
- **Mono: paths, code, JSON, params, chips — IBM Plex Mono** — IBM Plex Mono (OFL), weights 400/500. Self-host the font files.
## Spacing & shape
- Spacing: 8px base unit. Page: a 1440px container split into three columns — left nav 264px, center reading column max 760px, right rail 200px, gaps 40px; under 1100px the right rail hides; under 900px the nav collapses into a top drawer (hamburger in the header) and the reading column takes full width with 24px side padding. Section vertical rhythm 56px between endpoint blocks. Type scale: H1 (getting-started title) 36px Plex Sans 600; group headings 22px 600 with mono group slugs; endpoint titles 26px 600; body 15.5px / 1.7; descriptions 15px / 1.65 Soft Ink; eyebrow 12px 600 uppercase letter-spacing 0.14em Soft Ink; code and paths 13.5px / 1.65 Plex Mono; table text 14px. Buttons and inputs: height 40px; search input full nav width. Focus everywhere: 2px Signal Blue outline, 3px offset.
- Radius: 8px on code panels, tables, chips, search input, buttons. 6px on method chips and status chips (with 2px letter-spaced 10.5px labels).
## Motion
- Easing: --ease-out cubic-bezier(0.22, 0.61, 0.36, 1). Documentation should feel like paper, not a carousel.
- Reveal: endpoint blocks rise 8px and settle over 400ms as they enter (Motion whileInView, once); no stagger needed between blocks.
- Tab swap: 160ms crossfade; the active tab's 2px Signal Blue underline slides (layout animation, 200ms).
- CopyButton: icon swaps FileCopy→Check with a 140ms scale pop, reverting after 1.2s.
- JsonView collapse: max-height animates 240ms; chevron rotates 180deg.
- Search: nav items dim/sink over 180ms; the results bar slides down 8px into place; matched nav text gets a Blue Mist highlight that persists while the query lives.
- Active nav tracking: the active item's 2px rail and Blue Mist fill follow scroll (no animation lag over 100ms).
- OnThisPage rail: active anchor gets a Signal Blue dot that slides between rows (200ms).
- prefers-reduced-motion: reduce — no reveals, no sliding underlines (plain swap), no dot sliding; everything sits still and works. Use CSS @media in index.css plus Motion's useReducedMotion.
## Imagery
No photographs, no illustrations, no logos: the page is typography, tables and code panels — the craft object is the layout itself. Method chips, status chips, the version chip and the favicon are drawn in code. Icons: lucide-react only, stroke width 1.75.
## Tone
Documentation-plain: short declarative sentences, no marketing voice, one dry joke in the errors block.
---
— Prompt by VibeFather · https://vibefather.ai/t/api-reference-docs-site · CC BY-NC 4.0 (non-commercial; commercial use needs a VibeFather Pro license) · Request removal: https://vibefather.ai/takedown