# Tidal Design System — full documentation A shadcn-style component library and design token system, sourced from Figma. Lilac brand, Inter type, light + dark modes. --- # Introduction Tidal is a shadcn-style React component library and design token system sourced from Figma. - **Brand:** Lilac `#cd82f0` - **Fonts:** Inter (sans — UI, body, section headings), Iowan Old Style → Georgia (serif — **page `

` headings**, regular weight), JetBrains Mono (mono — code), Geist Mono (uppercase eyebrows). One compact 14px-base scale. - **Modes:** Light + Dark, toggled via `class="dark"` on `` - **Tokens:** Exported from Figma in DTCG format to `/design-tokens/`, imported by `packages/tokens/scripts/build.ts`, emitted as CSS vars + Tailwind preset + JSON. Agents: read `DESIGN.md` in the repo root before modifying anything. --- # Installation ```bash pnpm install pnpm tokens:build pnpm dev ``` Docs site runs at http://localhost:3000. --- # shadcn/ui theme Tidal is published as an installable shadcn/ui theme. Any project already on shadcn/ui can adopt Tidal's colors, radius, fonts, and text rendering with one command — no `@liquidai/*` packages required. It re-skins existing shadcn components; it does not ship Tidal's React components. ```bash npx shadcn@latest add https://tidal-design-system-docs.vercel.app/r/tidal-theme.json ``` ## What it sets - Full color set, light + dark (background, card, popover, primary, secondary, muted, accent, destructive, border, input, ring, sidebar, chart-1..5), in OKLCH. - Radius (`--radius: 0.375rem`) and font families (Inter / Iowan Old Style / JetBrains Mono). - Global text rendering: antialiasing, Inter stylistic sets (ss01, cv11), 14px base. It does NOT set per-component weights — shadcn components keep their own (e.g. a semibold CardTitle), so a vanilla shadcn app reads slightly heavier than Tidal. ## Monochrome controls, reserved lilac Unlike most "branded" shadcn themes, `--primary` stays NEUTRAL. Tidal's primary CTA and every selected/checked/filled control (Switch, Checkbox, Slider, Progress, Tabs) are monochrome — shadcn drives all of those from `--primary`, so it maps to Tidal's neutral inverse button. Lilac is reserved for `--ring` (focus), `--chart-1` (charts), and `--sidebar-primary` (active nav). ## Two ways to use Tidal - This theme — keep your own shadcn components, make them look like Tidal. - The component library — install `@liquidai/react` for Tidal's actual components (see Installation). ## Regenerating (maintainers) The theme is generated from Tidal's resolved tokens, never hand-edited: ```bash pnpm tokens:build # refresh resolved tokens (if they changed) pnpm registry:build # → registry/* and apps/docs/public/r/tidal-theme.json ``` `scripts/build-shadcn-registry.mjs` holds the Tidal→shadcn slot map and a dependency-free hex→OKLCH converter, and writes the item into the docs site's `public/r/` so it ships with the deploy. --- # Using with AI agents How to point an AI coding agent at Tidal docs — without cloning the repo. ## If you have the repo Mandatory reading in the repo root: - `CLAUDE.md` — the auto-loaded entry point. Imports `AGENTS.md` in full, and points at the layout library + the `tidal-screen` skill for building screens. - `AGENTS.md` — decision tables for which component to use, plus a forwarded summary of DESIGN.md §0–§8. - `DESIGN.md` — the full design rubric: token taxonomy, forbidden patterns, composition rules, and the §10 pre-build checklist. Required before writing any UI code. - `layout-library/` — canonical screen-layout archetypes. Match a screen to one and adapt its skeleton instead of inventing structure. - `ux_patterns_researched.md` — researched layout patterns and UX decisions. Reference when making structural layout choices. **Claude Code:** `CLAUDE.md` is auto-read on startup and imports `AGENTS.md` — no extra steps. Building a full screen or page? The `tidal-screen` skill activates on intent and routes you to a layout archetype. **Cursor / other agents:** Paste the contents of `DESIGN.md` into your agent context, or add a `.cursorrules` file that fetches it (see below). ## Remote usage (no clone needed) The docs site exposes machine-readable endpoints: - `/llms-full.txt` — all component docs + DESIGN.md + FIGMA_SYNC.md + the layout-archetype library in one file. Best single-URL context for agents. - `/llms.txt` — manifest of every doc page with one-line descriptions. Use this to let the agent fetch individual pages selectively. - `/design.md` — DESIGN.md alone: token taxonomy, forbidden patterns, composition rules. Add this to your agent's system prompt: ``` Read https://tidal-design-system-docs.vercel.app/llms-full.txt before building any UI with Tidal components. ``` ## Add to your project for agent access Drop one of these files in your project root so agents pick up Tidal context automatically. ### CLAUDE.md ```markdown # UI — Tidal Design System This project uses the Tidal Design System for all UI. Before building any UI: 1. Read https://tidal-design-system-docs.vercel.app/llms-full.txt — all component docs, design rules, and layout archetypes. 2. For a full screen or page, match it to a layout archetype (app-shell-panels, data-table, master-detail, form-settings, metric-dashboard, empty-onboarding) and adapt that skeleton — don't invent structure. See the References section of llms-full.txt. 3. Never inline hex colors. Always use Tidal semantic tokens (CSS vars or Tailwind utilities). 4. Never write `dark:` variants in components — fix the token if a dark variant is missing. 5. Default to the calmest variant. Escalate only with intent. 6. If the brief is underspecified, ask for clarity before writing code. ``` ### .cursorrules ``` # Tidal Design System Read https://tidal-design-system-docs.vercel.app/llms-full.txt before writing any UI code. Rules: - Use @liquidai/react components. Don't hand-build what the library already ships. - For full screens, match to a layout archetype (app-shell-panels, data-table, master-detail, form-settings, metric-dashboard, empty-onboarding) and adapt its skeleton — see the References section of llms-full.txt. - Use semantic token CSS vars (e.g. var(--primary)) or Tailwind utilities. No raw hex. - Follow the variant x tone API shape. One Primary action per page. - No dark: in component classes. Token-level fix only. - Ask for clarity before building underspecified screens (see DESIGN.md §10). ``` ## Prompt templates ### Build a new page ``` Build a [page type] page using the Tidal design system. Context: - Read https://tidal-design-system-docs.vercel.app/llms-full.txt first. - Data: [describe the data shown] - States: [loading / empty / error / populated] - Actions: [primary action, secondary actions, destructive actions if any] - Layout: match to an archetype (data-table / master-detail / form-settings / metric-dashboard / app-shell-panels) — or describe the structure and let the agent route it. Follow DESIGN.md §10: if anything is underspecified, ask before writing code. ``` ### Add a feature to an existing page ``` Add [feature] to [page/component]. Context: - Read https://tidal-design-system-docs.vercel.app/llms-full.txt first. - Existing components in scope: [list relevant components already on the page] - New components needed: [your best guess — the agent should verify against /llms.txt] - Interaction: [how the feature is triggered, what it controls, any states] Don't invent new components if Tidal already ships one that fits. ``` Per DESIGN.md §10: an agent should ask for clarity when a brief is underspecified — not silently fill in gaps. --- # Color tokens Semantic color tokens — light + dark values for every surface. Reference via CSS vars (e.g. `var(--primary)`) or Tailwind utilities, never raw hex. Groups: `background`, `foreground`, `card`, `popover`, `border`, `input`, `accent`, `ring`, `button` (primary/default/destructive/success), `sidebar` (8 tokens), `neon-green`. Faded surfaces: `--background-destructive-fill-10` / `--background-destructive-hover-20` (and `-success-` equivalents) for callouts and low-emphasis destructive backgrounds. Liquid (brand) palette: Lilac — a Tailwind-style 50-950 hex scale (400 is the original brand lilac #cd82f0, 500 the former "Darker" #c865f6). Secondary brand hues are Tailwind violet and indigo, referenced by step. Source of truth: `/design-tokens/Semantics.{light,dark}/liquid.tokens.json`. --- # Typography A 14px base with a ratio-based scale — headings stay proportional if the base changes; body line-height is relaxed (1.65). - **Families**: - `font-sans` = **Inter** (UI, body, section headings). Resolved via `var(--font-sans)`. - `font-serif` = **Iowan Old Style** → Georgia → serif (macOS system font; license a webfont to self-host everywhere). - `font-mono` = **JetBrains Mono**. - `font-heading` = `var(--font-serif)` (Iowan Old Style → Georgia). **Page `

` headings only** — serif, regular weight. Section headings (`h2`+) stay sans. - **Heading weight**: `--font-heading-weight` is `400` (regular). - **Weights**: only `font-normal` (400), `font-medium` (500), `font-semibold` (600). - **Sizes**: `text-base` = 14px; other steps are `calc(var(--text-base) * ratio)` (ratio-based). - **Leading** (unitless, scale with font-size): `leading-tight` 1.25, `leading-snug` 1.375, `leading-normal` 1.5, `leading-relaxed` 1.65, `leading-loose` 2. Rule — *larger text → tighter leading*: `tight` for display / text-3xl+, `snug` for headings (lg–2xl), `normal` for dense UI (labels, table cells, menu rows), **`relaxed` for body & prose (the default — a bare `text-base` resolves to it)**, `loose` for airy layouts only. Rarely set by hand. ## Text styles Canonical pairings of size × leading × weight × font. Use these together — don't pair `text-base` with a different `leading-*` ad-hoc. If a use case needs a different combo, propose a new style here. Sizes in pixels (font-size / line-height). | Use | Class | Size | Font | When to use | |---|---|---|---|---| | **Body (default)** | `text-base font-normal` | 14 / 18 | sans | Default for paragraphs, list items, prose. | | **Emphasis paragraph** | `text-base font-medium` | 14 / 18 | sans | Bump a single paragraph or sentence that needs to stand out within prose. Don't use for titles. | | **Description / secondary** | `text-base font-normal text-muted-foreground` | 14 / 18 | sans | Field descriptions, captions under content, muted metadata. Same size as body, tonally quieter. | | **Caption / metadata** | `text-xs leading-4 font-normal` | 11 / 16 | sans | Tiny labels, timestamps, badge text. | | **Subhead** | `text-lg leading-7 font-medium` | 16 / 24 | sans | Subsection headers within a card or section. | | **Section heading** | `text-xl leading-7 font-medium tracking-tight` | 18 / 24 | sans | Top of a page section. | | **Page heading** | `text-3xl leading-9 tracking-tight` | 30 / 36 | **serif** | Page title (PageHeader) + page `

`s. Serif via `font-heading`; regular weight via `--font-heading-weight`. | | **Display** | `text-5xl leading-none font-semibold tracking-tight` | 48 / 48 | sans | Marketing hero copy. Sparingly. | | **Code** | `text-sm leading-5 font-mono` | 12 / 18 | mono | Inline code references, prop names, file paths. | Non-code samples render in `font-sans` (Inter); code samples render in `font-mono` (JetBrains Mono). Set fonts explicitly rather than relying on inheritance so styles don't drift if a parent changes font. --- # Spacing & layout - **Spacing scale** (Compact — class numbers ≠ standard Tailwind px): `gap-1`=2, `gap-1.5`=4, `gap-2`=6, `gap-2.5`=8, `gap-3`=10, `gap-3.5`=12, `gap-4`=14, `gap-5`=18, `gap-6`=20, `gap-7`=24, `gap-8`=28, `gap-9`=36, `gap-10`=40. - **Canonical gap rules** (pick by intent): control padding `px-2`/`px-2.5`/`px-3` (sm/md/lg); icon↔text `gap-1.5` (6); sibling controls `gap-1` (4); menu rows `gap-0.5` (2); form stack `gap-2` (6); page section rhythm `space-y-10` (40). - **Control / icon sizes**: `--control-h-{sm,md,lg}` = 28/32/36; `--icon-{sm,md,lg}` = 12/16/20. - **Page layout**: `max-w-page` (`--page-max-width` 48rem) / `max-w-page-prose` (42rem). - **Radius**: `--radius` = 6px (base). `rounded-sm`=4, `rounded-md`=8, `rounded-lg`=10, `rounded-xl`=12, `rounded-[var(--radius-popover)]`=12 (floating surfaces, = xl), `rounded-full`. - **Shadows**: `shadow-sm`, `shadow`, `shadow-md`, `shadow-lg`, `shadow-xl`, `shadow-2xl`, `shadow-inner`. (Inputs/textareas/checkboxes are **flat** — no inner shadow.) --- # Focus rings Tidal 1.0 surfaces are **flat** — buttons, cards, popovers, and the sidebar use solid fills (no gradients). Hover is a flat color shift via `transition-colors` (e.g. `bg-[var(--button-default)] hover:bg-[var(--button-default-hover)]`). Focus rings are compound box-shadow tokens (not outlines): - `shadow-ring-primary`: a soft 3px neutral halo (`var(--ring)`) - `shadow-ring-destructive`: 2px background spacer + destructive ring Apply via `focus-visible:shadow-ring-primary focus-visible:outline-none focus-visible:border-focus`. --- # Button ## Usage — reserve Accent for one CTA per page **Primary** (high-contrast inverse — dark in light mode, light in dark mode) is the workhorse CTA. **Accent** (lilac, via `tone="accent"`) is the brand moment — reserved for the single most important action on a view. Aim for **at most one** Accent button per page. If you're reaching for multiple Accent buttons, first ask: can they all be `variant="primary"` (default tone)? If one genuinely outranks the others, keep that one on `tone="accent"` and demote the rest. Agents implementing designs should flag this back to the user when they see more than one Accent. ```tsx import { Button } from "@liquidai/react"; ``` ## Props | Prop | Type | Default | |---|---|---| | `variant` | `"primary" | "default" | "outline" | "ghost" | "link"` | `"primary"` | | `tone` | `"default" | "destructive" | "success"` | `"default"` | | `size` | `"sm" | "md" | "lg"` | `"md"` | | `loading` | `boolean` | `false` | | `disabled` | `boolean` | `false` | | `iconLeading` | `ReactNode` | — | | `iconTrailing` | `ReactNode` | — | | `asChild` | `boolean` (Radix Slot) | `false` | ## Notes - Icon color defaults to `muted-foreground`. The three "filled" variants (`variant=primary` with tones default/destructive/success) have white text and white icons. - `disabled` or `loading` sets inline `opacity: 0.5` (immune to class-merge quirks). - All fills are flat (Tidal 1.0) — hover is a flat color shift via `transition-colors`, no gradients. A colored tone (destructive/success/accent) applies only to `primary` (filled), `outline`, and `link`; `default`/`ghost` stay neutral. The `round` prop gives a full-radius pill. Source: `packages/react/src/components/button.tsx`. Figma node `2718:8237`. --- # IconButton Square button with a single icon. Shares `variant` and `tone` with `