Beautiful, interactive documentation for your design tokens.
Zero configuration. Multiple formats. One command.
- ๐จ Beautiful visuals - Colors, spacing, typography, and components
- ๐ Pre-ship checklist - Analytics tab catches broken aliases, hardcoded values, and architecture issues before you publish
- ๐ Multi-format support - Token Studio, W3C, Style Dictionary, Supernova, Figma API
- ๐ Smart copy - CSS Variables, SCSS, or Tailwind with one click
- ๐ Instant search -
Cmd+K/Ctrl+Kto find any token - ๐ Deep linking - Share direct URLs to specific tokens
- ๐ฌ Token scanner - Find unused tokens and hardcoded values
- โ Validation - Check token structure and catch errors
- ๐ Format conversion - Convert between token formats
- ๐ค Export - Generate CSS, SCSS, JS, or Tailwind config
- ๐ฏ Zero config - Works out of the box
- โก Two modes - CLI for quick preview or React component for apps
- ๐ฅ Live reload - Auto-refresh on file changes
npx tokvista tokens.jsonThat's it! Opens in your browser automatically.
npm install tokvistaimport { TokenDocumentation } from 'tokvista';
import 'tokvista/styles.css';
import tokens from './tokens.json';
export default function DesignSystem() {
return <TokenDocumentation tokens={tokens} />;
}Tokvista automatically detects and works with:
| Format | Example | Auto-detected |
|---|---|---|
| Token Studio | { "type": "color", "value": "#fff" } |
โ |
| W3C DTCG | { "$type": "color", "$value": "#fff" } |
โ |
| Style Dictionary | Nested objects with type/value | โ |
| Supernova | Array with id/name/tokenType/value | โ |
| Figma API | meta.variables structure | โ |
No configuration needed - just pass your tokens.
# Start interactive documentation
npx tokvista tokens.json
# Custom port
npx tokvista tokens.json --port 4000
# Don't open browser
npx tokvista tokens.json --no-open
# Disable live reload
npx tokvista tokens.json --no-watch# Interactive setup wizard
npx tokvista init
# Force overwrite existing config
npx tokvista init --force
# Skip preview after setup
npx tokvista init --no-preview# Check token health (human-readable)
npx tokvista analytics tokens.json
# JSON output for CI/CD pipelines
npx tokvista analytics tokens.json --format json
# Exit code 1 if broken aliases found
# Perfect for GitHub Actions, GitLab CI, etc.
# Scan for token usage and issues
npx tokvista scan tokens.json
# Scan specific directory
npx tokvista scan ./src --tokens tokens.json
# Finds:
# - Unused tokens (safe to remove)
# - Hardcoded colors that should use tokens
# - Hardcoded spacing values
# - Semantic tokens with hardcoded values# Validate token structure
npx tokvista validate tokens.json
# Checks for:
# - Invalid color values
# - Invalid dimension values
# - Broken token aliases
# - Missing type fields
# Exit code 1 on errors (perfect for CI/CD)# Compare two token files
npx tokvista diff tokens-v1.json tokens-v2.json
# Shows:
# - Added tokens
# - Removed tokens
# - Modified tokens with old/new values
# - Unchanged count# Export to CSS
npx tokvista export tokens.json --format css --output tokens.css
# Export to SCSS
npx tokvista export tokens.json --format scss --output _tokens.scss
# Export to JavaScript
npx tokvista export tokens.json --format json --output tokens.js
# Export to Tailwind
npx tokvista export tokens.json --format tailwind --output tailwind.config.js
# Print to stdout (for piping)
npx tokvista export tokens.json --format css# Convert to W3C DTCG
npx tokvista convert tokens.json --to w3c --output tokens-w3c.json
# Convert to Style Dictionary
npx tokvista convert tokens.json --to style-dictionary --output tokens-sd.json
# Convert to Supernova
npx tokvista convert tokens.json --to supernova --output tokens-sn.json
# Convert to Token Studio
npx tokvista convert tokens.json --to token-studio --output tokens-ts.json# Build all formats at once
npx tokvista build tokens.json --output-dir ./dist
# Creates:
# - tokens.css (CSS Variables)
# - tokens.scss (SCSS Variables)
# - tokens.js (JavaScript/TypeScript)
# - tailwind.config.js (Tailwind Config)
# Skip validation for faster builds
npx tokvista build tokens.json --output-dir ./dist --skip-validation| Command | Description |
|---|---|
tokvista [file] |
Start documentation server |
tokvista init |
Interactive configuration setup |
tokvista scan <dir|file> |
Analyze token usage and find issues |
tokvista validate <file> |
Validate token structure |
tokvista diff <old> <new> |
Compare two token files |
tokvista export <file> |
Export tokens to various formats |
tokvista convert <file> |
Convert between token formats |
tokvista analytics <file> |
Check token health (CI/CD ready) |
| Option | Description |
|---|---|
--config, -c
|
Path to config file |
--port, -p
|
Server port (default: 3000) |
--format |
Export format: css, scss, json, tailwind |
--output, -o
|
Output file path |
--output-dir |
Output directory for build command |
--to |
Target format for convert command |
--tokens |
Token file path for scan command |
--no-open |
Don't open browser automatically |
--no-watch |
Disable live reload |
--no-preview |
Skip preview after init |
--skip-validation |
Skip validation in build command |
--force, -f
|
Overwrite existing files |
--help, -h
|
Show help message |
<TokenDocumentation
tokens={tokens} // Required: your token object
title="Design System" // Optional: header title
subtitle="Documentation" // Optional: subtitle
logo="./logo.svg" // Optional: logo URL
categories={['foundation']} // Optional: filter tabs
theme="dark" // Optional: 'light' | 'dark' | 'system'
brandColor="#6366f1" // Optional: primary color
onTokenClick={(token) => {}} // Optional: click handler
/><TokenDocumentation
tokens={tokens}
loadDefaultFonts={false}
fontFamilySans="'Inter', sans-serif"
fontFamilyMono="'Fira Code', monospace"
/>Build custom layouts with individual components:
import { Colors, Spacing, Typography } from 'tokvista';
<Colors tokens={tokens} title="Color Palette" />
<Spacing tokens={tokens} />
<Typography tokens={tokens} />Available: Colors, Spacing, Sizes, Radius, Typography
{
"Foundation/Value": {
"base": {
"color": {
"blue": {
"500": { "value": "#3B82F6", "type": "color" }
}
},
"space": {
"md": { "value": "16px", "type": "spacing" }
}
}
},
"Semantic/Value": {
"fill": {
"primary": { "value": "{base.color.blue.500}", "type": "color" }
}
},
"Components/Mode 1": {
"button": {
"Primary": {
"fill": { "value": "{Semantic.fill.primary}", "type": "color" }
}
}
}
}{
"colors": {
"primary": {
"$value": "#3B82F6",
"$type": "color",
"$description": "Primary brand color"
}
}
}See GUIDE.md for complete setup instructions.
- Colors - Swatches with hex values and contrast ratios
- Spacing - Visual scale with pixel measurements
- Typography - Live font previews with size/weight
- Components - Organized by variant with all properties
- Click any token to copy
- Choose format: CSS Variables, SCSS, or Tailwind
- Format persists across sessions
- Toast confirmation with copied value
-
Cmd+K/Ctrl+Kto open - Search by name, value, or CSS variable
- Fuzzy matching
- Keyboard navigation
- Click result to copy
- Share direct links to tokens
- URL updates when clicking tokens
- Auto-scroll and highlight on page load
- Example:
https://yoursite.com/tokens#color-primary-500
Export all tokens as:
- CSS Variables
- SCSS Variables
- JavaScript/TypeScript
- Tailwind Config
With syntax highlighting and one-click copy.
# Old
npm install @nibin-org/tokens
# New
npm install tokvistaUpdate imports:
// Old
import { TokenDocumentation } from '@nibin-org/tokens';
// New
import { TokenDocumentation } from 'tokvista';No other changes needed - API is identical.
npx tokvista init
npx tokvista# Setup
nvm use 20
npm install
npm run build
# Run CLI locally
node dist/bin/tokvista.js tokens.json --port 4000
# Run demo
cd demo
npm install
npm run devContributions welcome! Please read CONTRIBUTING.md.
MIT ยฉ nibin-org