English | 日本語
This is a component library built with React.js and TypeScript.
It implements Goodpatch's "Sparkle Design" system on top of shadcn/ui.
- 🔧 Flexibility ... Because it is based on shadcn/ui and compatible with the shadcn/ui registry, you can introduce components one by one. It is also published as an npm package, so you can integrate it in the way that best fits each project.
- ♿️ Accessibility ... Sparkle Design is engineered with accessibility as a primary consideration.
- 🎨 Customizability ... A dedicated CLI tool lets you apply the same customizations found in the Figma files. This makes it easy to spin up code for design systems built on Sparkle Design.
- 🤖 AI Friendly ... Ships with skills and guard configurations for Claude Code, Cursor, and Codex. Maintain design system quality even during AI-assisted coding.
In an existing Next.js / Vite project, a single command completes the integration:
npx --yes sparkle-design-cli setup --assistant claudeThis automatically:
- Detects your package manager (pnpm / npm / yarn / bun)
- Adds
sparkle-designto dependencies andtailwindcss+@tailwindcss/postcssto devDependencies - Generates
sparkle.config.json/postcss.config.mjs/ Tailwind entry CSS (Next.js:globals.css, Vite:index.css) if missing - Writes the Sparkle Design guard block +
lint:sparklescript toCLAUDE.md(and toAGENTS.mdtoo when one already exists) - Installs an assistant-specific Stop hook into
.claude/settings.json/.cursor/hooks.json/.codex/hooks.json(lint:sparkle --strict || exit 2) so findings block the agent from finishing the turn - Generates
sparkle-design.cssandSparkleHead.tsx(and for Vite projects, also injects a managed font<link>block intoindex.html's<head>)
--assistant accepts claude / cursor / codex / generic. Existing files are never overwritten.
Once the setup is complete, place the generated SparkleHead in the <head> of your root layout.
import { SparkleHead } from "./SparkleHead";
export default function RootLayout({ children }) {
return (
<html>
<head>
<SparkleHead />
</head>
<body>{children}</body>
</html>
);
}
@next/next/no-head-elementin Next.js App Router: If your project extendsnext/core-web-vitals, placing a<head>element directly inlayout.tsxmay trigger a lint error. Add// eslint-disable-next-line @next/next/no-head-elementto suppress it, or consider usingnext/fontas an alternative.
Customize primary color, fonts, border radius, and more via sparkle.config.json. To tweak settings inside Figma, the Sparkle Design Theme Settings plugin is available. See sparkle-design-cli generate --help for details.
⚠️ Note for TailwindCSS v4 when using sparkle-design as an npm package: TailwindCSS v4 does not automatically scan utility classes insidenode_modules. When consumingsparkle-designas an npm package, your entry CSS needs an@sourcedirective like the one below:@import "tailwindcss"; @source "../../node_modules/sparkle-design/dist"; @import "./sparkle-design.css";
sparkle-design-cliauto-scans yourpackage.json(dependencies / devDependencies) ongenerate/setupand automatically inserts the matching@sourcedirective when it detectssparkle-design. No manual config is required. If you want to include additional design system packages, add them toextend.source-packagesinsparkle.config.json; the detected packages and your explicit list will be merged. When an existing entry CSS lacks@import "tailwindcss";(e.g. straight fromcreate-vite), the CLI auto-prepends the canonical import before continuing the patch, and the order of@import/@sourceis normalized to comply with the CSS spec, so both Vite and Next.js layouts reach a fully working state in a single setup run.
If you use an AI agent such as Claude Code, GitHub Copilot, Cursor, Codex, Gemini CLI, or Antigravity, you can install the Sparkle Design skills through the official gh skill command (requires gh CLI v2.90+), which lets the agent guide you through setup.
# Install only the setup-sparkle-design skill (recommended)
gh skill install goodpatch/sparkle-design setup-sparkle-design --agent claude-code
# Interactively pick multiple skills (setup / add-component / accessibility-checker / change-sparkle-config)
gh skill install goodpatch/sparkle-design --agent claude-code
# Inspect a skill before installing
gh skill preview goodpatch/sparkle-design setup-sparkle-designAfter installation, asking the agent to "install Sparkle Design" triggers the setup-sparkle-design skill, which inspects the project and guides you through only the missing steps. Use --agent claude-code / --agent github-copilot / --agent cursor / --agent codex / --agent gemini / --agent antigravity to target a specific agent (the default for non-interactive runs is github-copilot).
Fallback if gh CLI is not available: The same skills are also published via Vercel's skills CLI:
npx skills add goodpatch/sparkle-design -s setup-sparkle-design npx skills add goodpatch/sparkle-design --all
import React from "react";
import { Button, Badge, Card } from "sparkle-design";
function App() {
return (
<div>
<Card>
<h1>Example using Sparkle Design</h1>
<Badge variant="primary">New feature</Badge>
<Button variant="primary" size="md">
Click the button
</Button>
</Card>
</div>
);
}
export default App;Using with Server Components: For components that contain
"use client", use subpath imports. Each component's README includes Server Component / Client Component information.import { Button } from "sparkle-design/button";
After editing sparkle.config.json, regenerate the CSS:
npx sparkle-design-cli generateAfter making Sparkle Design-related code changes, check for anti-patterns:
npx sparkle-design-cli check srcIf you prefer a step-by-step installation without CLI setup, run npx --yes sparkle-design-cli --help / npx --yes sparkle-design-cli generate --help / npx --yes sparkle-design-cli setup --help to see the usage of each subcommand. See also the sparkle-design-cli page on npm.
Sparkle Design works with the shadcn/ui registry. You can copy the registry URL from Storybook.
Refer to the official documentation for details on the shadcn/ui registry.
pnpm dlx shadcn@latest add [registry URL]You can also specify namespaces in components.json to install components by name.
{
"registries": {
"@sparkle-design": "https://sparkle-design.goodpatch.com/r/{name}.json"
}
}pnpm dlx shadcn@latest add @sparkle-design/buttonFor environment setup, component creation, testing, and contribution guidelines, see CONTRIBUTING.md.
├─ src/
│ ├─ app/ # Sparkle Design pages and style files
│ ├─ components/ # React components
│ └─ lib/ # Shared utilities
├─ scripts/ # Various scripts
├─ docs/
│ └─ ai-instructions/ # Development, testing, and AI guidelines (source)
└─ .github/ # GitHub configuration
The Sparkle Design badge indicates that a component uses Sparkle Design. Add the following snippet to your README:
[](https://sparkle-design.goodpatch.com/)Please refer to the table on README.md for the current implementation status of components.
Copyright 2026 Goodpatch Inc.