# Shavin Design System (@shavin/ui) > Enterprise-grade React design system delivering a strict two-tier token architecture, WCAG 2.1 AAA accessible primitives, 24 accent colors, live theme configurator, visual block builder, and zero-hallucination Model Context Protocol (MCP) AI server integration. ## System Overview & Mental Model - **Package**: `@shavin/ui` - **Import Rule**: ALWAYS import from root `@shavin/ui`. NEVER deep import (e.g. `@shavin/ui/primitives/...` is strictly forbidden). - **Two-Tier Tokens**: Foundation scale (`--n-0` through `--n-1000`) is mapped to semantic tokens (`--bg-canvas`, `--bg-surface`, `--fg`, `--border-hairline`, `--accent`). - **Zero Hex/RGB**: Never use hardcoded hex codes, `rgb()`, or `--n-*` variables in markup. Use semantic Tailwind utilities exclusively (`bg-surface`, `text-fg`, `border-hairline`). - **Concentric Radius Law**: - Controls (buttons, inputs, badges, switches): `rounded-[var(--radius-lg)]` (pill-shaped at Full preset). - Containers & Panels (cards, dialogs, popovers, menus): `rounded-[var(--radius-panel)]` (intentionally capped at finite curve, never pill). - Concentric Nesting: $R_{\text{inner}} = \max(0, R_{\text{outer}} - P)$ using Tailwind utilities `rounded-panel-p3`, `rounded-panel-p5`, `rounded-panel-inner`. - **Typography Hierarchy**: Pair title `text-fg` with `text-fg-subtle` (or `color="subtle"`). Never pair `text-fg` with `text-fg-muted`. - **Radix Selection**: - Modals / Palette: Radix Dialog (`Spotlight`, `ProfileModal`, `Dialog`). - Destructive: Radix AlertDialog (focus defaults to Cancel, no outside-click dismiss). - Select: Radix Select (`value: ""` is forbidden reserved sentinel; scroll via `Select.Viewport`). - Overlay Panels: Any floating overlay surface MUST have `data-panel` attribute. - **Monolithic Context File**: Ingest [llms-full.txt](https://docs.shavin.cc/llms-full.txt) for exhaustive tokens, ThemeProvider props, all 139 component declarations, copy-paste code snippets, and anti-patterns in a single prompt. ## Installation & Quickstart - **Automated 1-Command Scaffolding (Recommended)**: ```bash npx @shavin/cli init ``` Auto-detects project framework (Next.js App/Pages Router, Vite, Remix), installs `@shavin/ui`, configures Tailwind preset, imports `@shavin/ui/styles.css`, and wraps root layout in ``. - **Manual Installation**: ```bash npm install @shavin/ui ``` 1. **Tailwind Preset**: Add `presets: [require("@shavin/ui/tailwind-preset")]` to `tailwind.config.ts`. 2. **Stylesheet**: Add `@import "@shavin/ui/styles.css";` to root CSS (`globals.css`). 3. **Root Provider**: Wrap app in `{children}`. 4. **Next.js Config**: Add `transpilePackages: ["@shavin/ui"]` to `next.config.mjs`. ## Core Documentation & Guides - [Getting Started](https://docs.shavin.cc/get-started/getting-started): Package installation, Tailwind preset, stylesheet import, and root ThemeProvider setup. - [What is Shavin](https://docs.shavin.cc/get-started/what-is-shavin): Architectural principles, two-tier token model, and accessibility guarantees. - [Shavin Ecosystem](https://docs.shavin.cc/get-started/shavin-ecosystem): Monorepo packages (@shavin/ui, @shavin/mcp, @shavin/cli, @shavin/block-schema, @shavin/builder-engine). - [Working with AI](https://docs.shavin.cc/get-started/working-with-ai): AI agent workflows, zero-hallucination protocols, and coding rules. - [Model Context Protocol (MCP)](https://docs.shavin.cc/get-started/mcp): 20 modular MCP server tools for tokens, components, guidelines, and live DOM validation. - [Dev Inspector & Bridge](https://docs.shavin.cc/get-started/dev-inspector): In-browser floating debug tool for live token compliance, contrast audits, and Agent-Browser Bridge (:7428) telemetry. - [Accessibility (WCAG 2.1 AAA)](https://docs.shavin.cc/get-started/accessibility): Contrast ratios, focus ring management, ARIA roles, and screen-reader testing. - [Tag Reference Cheat Sheet](https://docs.shavin.cc/components/tag-reference): Exhaustive cheat sheet of all JSX component tags, categories, and use cases. ## Shavin Web Ecosystem & Tooling - [Shavin Studio](https://www.shavin.cc/studio): Visual canvas, drag-and-drop block builder, and theme inspector. - [Block Catalog & Registry](https://www.shavin.cc/blocks): 55+ production-ready blocks across Hero, Features, Dashboards, Pricing, Testimonials, Footers. - [Dev Inspector & Bridge](https://www.shavin.cc/dev-inspector): Live browser bridge daemon (:7428), SSE audit feed, and real-time token compliance. - [Model Context Protocol](https://www.shavin.cc/mcp): 20 modular AI agent tools for Cursor, Claude Desktop, Antigravity, and VS Code. - [SHAVIN.md AI Context](https://www.shavin.cc/shavin-md): Declarative AI constitution and zero-hallucination agent rules generator. - [Open Source & License](https://www.shavin.cc/open-source): MIT-licensed core primitives and zero-telemetry design philosophy. - [Changelog](https://www.shavin.cc/changelog): Release history and monorepo evolution. - [About Shavin](https://www.shavin.cc/about): Mission, two-tier token philosophy, and accessibility standards. ## Design Foundations & Tokens - [Theming Engine](https://docs.shavin.cc/foundations/theming): ThemeProvider configuration, 24 accent palettes, 5 neutral gray scales, radius presets, and scaling options. - [Colors & Design Tokens](https://docs.shavin.cc/foundations/colors): Semantic token dictionary, background surfaces, foreground text, borders, and status roles. - [Typography Overview](https://docs.shavin.cc/foundations/typography/overview): Type scales, display and body fonts, measure limits (max-w-2xl), text-balance, and tabular numerals. - [Spacing System](https://docs.shavin.cc/foundations/spacings): 4px grid rhythm, spatial hierarchy zones (Page, Container, Surface, Element). - [Radius & Geometry](https://docs.shavin.cc/foundations/radius): Concentric radius laws, control radius vs panel radius, and nested curve calculations. - [Shadows & Elevation](https://docs.shavin.cc/foundations/shadows): Panel and modal elevation shadows with light/dark elevation matching. - [Motion & Physics](https://docs.shavin.cc/foundations/motion): Custom cubic-bezier easings, the Frequency Law, and entrance choreography. - [Layout & App Shell](https://docs.shavin.cc/foundations/layout): AppFrame, Sidebar, NavRail, TopBar, and responsive viewport partitioning. - [Aspect Ratio](https://docs.shavin.cc/foundations/aspect-ratio): Media framing, video containers, and proportional card insets. ## Layout & Shell Components - [](https://docs.shavin.cc/components/box): Low-level layout container supporting display, position, padding, margin, width, and height. - [](https://docs.shavin.cc/components/flex): Flexbox container with direction, align, justify, wrap, and gap props. - [](https://docs.shavin.cc/components/grid): CSS Grid container with responsive columns, rows, gap, and alignment. - [](https://docs.shavin.cc/components/container): Centered content wrapper with responsive max-width constraints (sm, md, lg, xl, 2xl). - [
](https://docs.shavin.cc/components/section): Vertical page section wrapper with token-driven vertical rhythm padding. - [](https://docs.shavin.cc/foundations/app-shell): Responsive master application shell organizing Sidebar, NavRail, TopBar, and main view. - [](https://docs.shavin.cc/components/sidebar): Collapsible left application sidebar with Header, Body, Footer, Section, and Item sub-components. - [](https://docs.shavin.cc/foundations/app-shell): Slim icon-only vertical navigation rail for multi-workspace application switchers. - [](https://docs.shavin.cc/foundations/app-shell): Application header bar with title, search input, actions, and profile trigger slots. - [](https://docs.shavin.cc/components/inset): Negative-margin wrapper clipping children flush to card or panel borders. - [](https://docs.shavin.cc/foundations/aspect-ratio): Proportional aspect-ratio wrapper (16:9, 4:3, 1:1) backed by Radix. ## Typography Components - [](https://docs.shavin.cc/components/typography/headings): Semantic heading (h1-h6) with sizes (xs to 3xl), weight, and text-balance. - [](https://docs.shavin.cc/components/typography/body): Paragraph or span body copy with sizes, weights, and semantic color roles (default, subtle, muted, accent). - [](https://docs.shavin.cc/components/typography/em-strong): Inline italic emphasis element. - [](https://docs.shavin.cc/components/typography/em-strong): Inline bold weight text element. - [](https://docs.shavin.cc/components/typography/em-strong): Inline curly quotation element. - [
](https://docs.shavin.cc/components/typography/quotes): Block-level quotation block with left accent bar and muted styling. - [](https://docs.shavin.cc/components/typography/code-kbd): Monospace code badge with hairline border and surface background. - [](https://docs.shavin.cc/components/typography/code-kbd): Keyboard shortcut key badge (e.g. ⌘K, Ctrl+C, Shift+Enter). - [](https://docs.shavin.cc/components/typography/links): Accessible hyperlink anchor with hover underline and color variants. ## Buttons & Actions - [