Check UI code against the design system
check_uiLint TSX/JSX against your design system to catch hardcoded colors, spacing and radius, wrong or unknown components and props, and icon-only buttons without accessible names, with suggested fixes.
Instructions
Lint TSX/JSX against the design system. Reports hardcoded colors, spacing and radius (with the nearest token), native elements that have a design-system component, unknown components, props and variant values, and icon-only buttons without an accessible name. Each diagnostic has line/column, a rule id, a message and a suggested fix. Run it on every snippet or file you write and fix all errors. Pass path for a file in the project, or code for unsaved code, with path (or filename) naming the file it is for or its project folder.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check_ui"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | TSX/JSX source to check (up to 1,000,000 characters). | |
| path | No | Path of a .tsx, .jsx, .ts or .js file, relative to the project root (the monorepo root, when served from there) or absolute: the file to check, or, with `code`, the file the code is for, as `filename`. With `code`, a project folder only picks the project. | |
| limit | No | Most diagnostics to return, errors first (default 50). The counts and byRule cover all of them. | |
| filename | No | Name to report `code` under; a .jsx extension parses it as JSX. At a monorepo root, the path the code will be saved under, which picks the project whose design system checks it. When the server was started outside your project, pass it as an absolute path: the project is found from it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when there are no errors. | |
| file | Yes | ||
| byRule | Yes | Every finding per rule, shown or not. | |
| notice | No | Set when no components or no color tokens were found, so rules did not run, when components came from modules the model does not include, when the project depends on a component library onsystem does not read yet, or when its dependencies are not installed. | |
| omitted | Yes | Diagnostics left out by `limit`. | |
| skipped | No | Why the file was not checked: it renders an image (next/og) or an email, or the config's `exclude` leaves it out. | |
| unchecked | No | Components imported from modules the model does not include, not checked. | |
| errorCount | Yes | ||
| diagnostics | Yes | Up to `limit` diagnostics, errors first; `omitted` says how many more there are. | |
| warningCount | Yes |