Overview
Swatch allows you to inspect and edit your color tokens directly inside of your local environment. Click any element, inspect the color tokens, view accessibility requirements and make updates.
Swatch makes it easy to dial in your color tokens. Your agent can also use it to quickly sync with your design tools like Figma. Try it right now. Click the tool in the lower left of this page.
Install the package
npm install swatch-token -D
Add the plugin
// vite.config.ts
import swatch from "swatch-token/vite"
export default {
plugins: [swatch()],
}
Features
Live preview. Change a color and see it in real time.
Works with agents. A built-in MCP server lets coding agents read your tokens and commit what you save.
Light and Dark mode. See both tokens side by side.
Inspect and multi-select. Hover and see the tokens behind any element. Shift+click to see multiple elements.
Contrast. See the WCAG contrast ratio against its surface.
All color formats. Set tokens using HEX, RGB, HSL or OKLCH.
Reference tokens. Set a token's value to reference other tokens. Type - to search across all tokens.
Count of usage. Quickly see how many times each token is used across your project.