A standalone, self-hosted interactive graph-based visualizer for exploring design token relationships and connections.
- 🕸️ Graph Visualization: Interactive force-directed graph showing token relationships
- 🔗 Token Connections: Visualize how tokens reference each other (e.g.,
text.strong→neutral.1) - 🎨 Layer Filtering: Filter by token layer (primitive, semantic, component)
- 🔍 Search: Search tokens by name, color, or description
- 🌈 Mode Switching: View token relationships for different theme modes
- 📊 Node Details: Click nodes to see detailed information and connections
- 📁 File Upload: Upload JSON, CSS, or TSX files to visualize your own tokens
- Node.js 20+
- npm or yarn
cd teardrop-token-visualizer
npm installIf you have a public/token-graph.json file, it will be loaded automatically. Otherwise, you can upload your own token files using the file upload feature in the toolbar.
To build a token graph from YAML definitions (if you have the build script):
npm run build-graphStart the development server:
npm run devThe visualizer will open at http://localhost:3002
Build for production:
npm run buildThe built files will be in the dist/ directory.
- Upload Token Files: Use the toolbar to upload JSON, CSS, or TSX files containing your design tokens
- View the Graph: The main view shows all tokens as nodes, with arrows indicating references
- Filter by Layer: Use the layer dropdown to show only primitives, semantic, or component tokens
- Search: Type in the search box to filter tokens by name or value
- Switch Modes: Change the mode dropdown to see relationships for different theme modes
- Explore Connections: Click on any node to see its details and all connections
- Interact: Drag nodes to rearrange, zoom with mouse wheel, pan by dragging background
- JSON: Standard JSON format with nodes and links, or Style Dictionary format
- CSS: CSS files with custom properties (CSS variables)
- TSX/TS: TypeScript files containing token definitions
The graph shows:
- Nodes: Individual tokens (primitives, semantic, components)
- Links: References between tokens (e.g.,
breadcrumbs.text.default→text.strong→neutral.1)
Node colors:
- Purple: Primitive tokens
- Blue: Semantic tokens
- Green: Component tokens
- React 18 - UI framework
- react-force-graph-2d - Graph visualization
- Vite - Build tool and dev server
- Radix UI - UI components
teardrop-token-visualizer/
├── scripts/
│ └── build-graph.js # Script to parse YAML and build graph JSON (optional)
├── public/
│ └── token-graph.json # Optional default graph data
├── src/
│ ├── components/
│ │ ├── TokenGraph.jsx # Main graph visualization component
│ │ ├── Sidebar.jsx # Sidebar with search and filters
│ │ ├── Toolbar.jsx # Toolbar with file upload
│ │ └── ...
│ ├── utils/
│ │ └── fileParser.js # File parsing utilities
│ ├── App.jsx # Main app component
│ └── main.jsx # React entry point
├── package.json
├── vite.config.js
└── README.md
See LICENSE file for details.