Skill library

Agent skill UI design

21st Design Sync

Shape a web interface around a coherent visual direction.

  • UI design
  • Design tokens

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add 21st-dev/skill --skill 21st-design-sync --agent claude-code --yes

Check this file in your project.claude/skills/21st-design-sync/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add 21st-dev/skill --skill 21st-design-sync

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. The current global CSS or token sources, the intended theme name, and a 21st API key if you approve publishing the result.

View operation manual

What this skill helps with

  • Shape a web interface around a coherent visual direction.

Good for

  • Visual direction
Task
Extract and preview a publishable light and dark shadcn theme
Inputs
The current global CSS or token sources, the intended theme name, and a 21st API key if you approve publishing the result.
Core commands
publish-theme
Skill name
21st-design-sync
Repository
21st-dev/skill

Start from the actual project

A broad request

Sync my globals.css to 21st.

The CLI needs two non-empty token blocks. A full stylesheet can include unrelated rules, and publishing creates a new public theme.

A workflow you can verify

  1. List the actual source files, selectors and missing values before exporting.
  2. A standalone file contains real token values and readable light and dark previews.
  3. The command returns a theme URL that opens in the community library.

21st Design Sync operation manual

Extract and preview a publishable light and dark shadcn theme

The current global CSS or token sources, the intended theme name, and a 21st API key if you approve publishing the result.

  1. Find the theme’s real light and dark tokens

    List the actual source files, selectors and missing values before exporting.

    Prompt · Step 1
    Use 21st-design-sync from 21st-dev/skill. Read the installed SKILL.md first. Keep login tokens and API keys out of command records, docs, and code.
    
    Inspect [project styles and representative route] for the current shadcn tokens. Locate :root and .dark, match the real semantic color roles and radius values, and identify the activate-dark selector. Check whether Tailwind v4 @theme inline only maps through to those values. List gaps and confirm which brand tokens may be shared.
  2. Export two CSS token blocks and preview them

    A standalone file contains real token values and readable light and dark previews.

    Prompt · Step 2
    Use 21st-design-sync from 21st-dev/skill. Read the installed SKILL.md first. Keep login tokens and API keys out of command records, docs, and code.
    
    Build [approved theme name] as a standalone project-theme.css with non-empty :root and .dark blocks, preserving each actual color format. If dark mode is missing, propose a dark variant with the same semantic names and ask me to approve the preview. Load the export in a local fixture and inspect background, foreground, primary, ring, and borders in both modes. Show the file, previews, and suggested name and tags.
  3. Publish once after explicit approval

    The command returns a theme URL that opens in the community library.

    Prompt · Step 3
    Use 21st-design-sync from 21st-dev/skill. Read the installed SKILL.md first. Keep login tokens and API keys out of command records, docs, and code.
    
    After I approve [theme CSS, name, tags and public visibility], use npx @21st-dev/cli publish-theme with the confirmed file and --name. Use the API key from an existing environment variable as documented. A browser login by itself does not authorize this command. Run it once, report the returned URL and open it to verify the title and both themes. If the API key is missing, keep the artifact local and report that prerequisite.

Look up a CLI operation

Read the installed Skill when applying these commands.

Can I update the colors by publishing the same file twice?21st CLI
Command or reference
publish-theme
Examples
Each publish-theme call creates a separate theme. Use the documented edit operation for applicable metadata. To replace colors, plan a new theme and decide explicitly what happens to the previous URL.

Troubleshooting and FAQ

Can I update the colors by publishing the same file twice?

Each publish-theme call creates a separate theme. Use the documented edit operation for applicable metadata. To replace colors, plan a new theme and decide explicitly what happens to the previous URL.