UI Styling Skill

Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs.

by nextlevelbuilder·Apache-2.0 license·★ 129,643 Stars on the repo·GitHub ↗

Use now

Files of UI Styling Skill

nextlevelbuilder/main1 file shown
SKILL.md
Show the full text337 lines

UI Styling Skill

Comprehensive skill for creating beautiful, accessible user interfaces combining shadcn/ui components, Tailwind CSS utility styling, and canvas-based visual design systems.

Reference

When to Use This Skill

Use when:

  • Building UI with React-based frameworks (Next.js, Vite, Remix, Astro)
  • Implementing accessible components (dialogs, forms, tables, navigation)
  • Styling with utility-first CSS approach
  • Creating responsive, mobile-first layouts
  • Implementing dark mode and theme customization
  • Building design systems with consistent tokens
  • Generating visual designs, posters, or brand materials
  • Rapid prototyping with immediate visual feedback
  • Adding complex UI patterns (data tables, charts, command palettes)

Core Stack

Component Layer: shadcn/ui
  • Pre-built accessible components via Radix UI primitives
  • Copy-paste distribution model (components live in your codebase)
  • TypeScript-first with full type safety
  • Composable primitives for complex UIs
  • CLI-based installation and management
Styling Layer: Tailwind CSS
  • Utility-first CSS framework
  • Build-time processing with zero runtime overhead
  • Mobile-first responsive design
  • Consistent design tokens (colors, spacing, typography)
  • Automatic dead code elimination
Visual Design Layer: Canvas
  • Museum-quality visual compositions
  • Philosophy-driven design approach
  • Sophisticated visual communication
  • Minimal text, maximum visual impact
  • Systematic patterns and refined aesthetics

Script Paths

Script paths in this skill and its references/ are relative to the directory that contains this SKILL.md, not to the project: scripts/<file> is this skill's own scripts/ folder, and ../<skill>/scripts/<file> is a sibling sub-skill installed alongside it. Build the full path from that directory (Claude Code reports it as the skill's base directory when the skill loads) and keep the working directory at the project root — the scripts read and write project files such as docs/brand-guidelines.md, assets/design-tokens.json or src/ relative to it.

Quick Start

Component + Styling Setup

Install shadcn/ui with Tailwind:

npx shadcn@latest init

CLI prompts for framework, TypeScript, paths, and theme preferences. This configures both shadcn/ui and Tailwind CSS.

Add components:

npx shadcn@latest add button card dialog form

Use components with utility styling:

import { Button } from "@/components/ui/button"
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"

export function Dashboard() {
  return (
    <div className="container mx-auto p-6 grid gap-6 md:grid-cols-2 lg:grid-cols-3">
      <Card className="hover:shadow-lg transition-shadow">
        <CardHeader>
          <CardTitle className="text-2xl font-bold">Analytics</CardTitle>
        </CardHeader>
        <CardContent className="space-y-4">
          <p className="text-muted-foreground">View your metrics</p>
          <Button variant="default" className="w-full">
            View Details
          </Button>
        </CardContent>
      </Card>
    </div>
  )
}
Alternative: Tailwind-Only Setup

Vite projects:

npm install -D tailwindcss @tailwindcss/vite
// vite.config.ts
import tailwindcss from '@tailwindcss/vite'
export default { plugins: [tailwindcss()] }
/* src/index.css */
@import "tailwindcss";

Component Library Guide

Comprehensive component catalog with usage patterns, installation, and composition examples.

See: references/shadcn-components.md

Covers:

  • Form & input components (Button, Input, Select, Checkbox, Date Picker, Form validation)
  • Layout & navigation (Card, Tabs, Accordion, Navigation Menu)
  • Overlays & dialogs (Dialog, Drawer, Popover, Toast, Command)
  • Feedback & status (Alert, Progress, Skeleton)
  • Display components (Table, Data Table, Avatar, Badge)

Theme & Customization

Theme configuration, CSS variables, dark mode implementation, and component customization.

See: references/shadcn-theming.md

Covers:

  • Dark mode setup with next-themes
  • CSS variable system
  • Color customization and palettes
  • Component variant customization
  • Theme toggle implementation

Accessibility Patterns

ARIA patterns, keyboard navigation, screen reader support, and accessible component usage.

See: references/shadcn-accessibility.md

Covers:

  • Radix UI accessibility features
  • Keyboard navigation patterns
  • Focus management
  • Screen reader announcements
  • Form validation accessibility

Tailwind Utilities

Core utility classes for layout, spacing, typography, colors, borders, and shadows.

See: references/tailwind-utilities.md

Covers:

  • Layout utilities (Flexbox, Grid, positioning)
  • Spacing system (padding, margin, gap)
  • Typography (font sizes, weights, alignment, line height)
  • Colors and backgrounds
  • Borders and shadows
  • Arbitrary values for custom styling

Responsive Design

Mobile-first breakpoints, responsive utilities, and adaptive layouts.

See: references/tailwind-responsive.md

Covers:

  • Mobile-first approach
  • Breakpoint system (sm, md, lg, xl, 2xl)
  • Responsive utility patterns
  • Container queries
  • Max-width queries
  • Custom breakpoints

Tailwind Customization

Config file structure, custom utilities, plugins, and theme extensions.

See: references/tailwind-customization.md

Covers:

  • @theme directive for custom tokens
  • Custom colors and fonts
  • Spacing and breakpoint extensions
  • Custom utility creation
  • Custom variants
  • Layer organization (@layer base, components, utilities)
  • Apply directive for component extraction

Visual Design System

Canvas-based design philosophy, visual communication principles, and sophisticated compositions.

See: references/canvas-design-system.md

Covers:

  • Design philosophy approach
  • Visual communication over text
  • Systematic patterns and composition
  • Color, form, and spatial design
  • Minimal text integration
  • Museum-quality execution
  • Multi-page design systems

Utility Scripts

Python automation for component installation and configuration generation.

shadcn_add.py

Add shadcn/ui components with dependency handling:

python scripts/shadcn_add.py button card dialog
tailwind_config_gen.py

Generate tailwind.config.js with custom theme:

python scripts/tailwind_config_gen.py --colors brand:blue --fonts display:Inter

The generator refuses to create or replace a config when any sibling tailwind.config.js, .cjs, .mjs, or .ts file already exists. Review the reported config first, then pass --force only when the competing output is intentional:

python scripts/tailwind_config_gen.py --colors brand:blue --force

Best Practices

  1. Component Composition: Build complex UIs from simple, composable primitives
  2. Utility-First Styling: Use Tailwind classes directly; extract components only for true repetition
  3. Mobile-First Responsive: Start with mobile styles, layer responsive variants
  4. Accessibility-First: Leverage Radix UI primitives, add focus states, use semantic HTML
  5. Design Tokens: Use consistent spacing scale, color palettes, typography system
  6. Dark Mode Consistency: Apply dark variants to all themed elements
  7. Performance: Leverage automatic CSS purging, avoid dynamic class names
  8. TypeScript: Use full type safety for better DX
  9. Visual Hierarchy: Let composition guide attention, use spacing and color intentionally
  10. Expert Craftsmanship: Every detail matters - treat UI as a craft

Reference Navigation

Component Library

  • references/shadcn-components.md - Complete component catalog
  • references/shadcn-theming.md - Theming and customization
  • references/shadcn-accessibility.md - Accessibility patterns

Styling System

  • references/tailwind-utilities.md - Core utility classes
  • references/tailwind-responsive.md - Responsive design
  • references/tailwind-customization.md - Configuration and extensions

Visual Design

  • references/canvas-design-system.md - Design philosophy and canvas workflows

Automation

  • scripts/shadcn_add.py - Component installation
  • scripts/tailwind_config_gen.py - Config generation

Common Patterns

Form with validation:

import { useForm } from "react-hook-form"
import { zodResolver } from "@hookform/resolvers/zod"
import * as z from "zod"
import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from "@/components/ui/form"
import { Input } from "@/components/ui/input"
import { Button } from "@/components/ui/button"

const schema = z.object({
  email: z.string().email(),
  password: z.string().min(8)
})

export function LoginForm() {
  const form = useForm({
    resolver: zodResolver(schema),
    defaultValues: { email: "", password: "" }
  })

  return (
    <Form {...form}>
      <form onSubmit={form.handleSubmit(console.log)} className="space-y-6">
        <FormField control={form.control} name="email" render={({ field }) => (
          <FormItem>
            <FormLabel>Email</FormLabel>
            <FormControl>
              <Input type="email" {...field} />
            </FormControl>
            <FormMessage />
          </FormItem>
        )} />
        <Button type="submit" className="w-full">Sign In</Button>
      </form>
    </Form>
  )
}

Responsive layout with dark mode:

<div className="min-h-screen bg-white dark:bg-gray-900">
  <div className="container mx-auto px-4 py-8">
    <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
      <Card className="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700">
        <CardContent className="p-6">
          <h3 className="text-xl font-semibold text-gray-900 dark:text-white">
            Content
          </h3>
        </CardContent>
      </Card>
    </div>
  </div>
</div>

Resources

1---
2name: ui-styling
3description: Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.
4argument-hint: "[component or layout]"
5license: MIT
6metadata:
7 author: claudekit
8 version: "1.0.0"
9---
10 
11# UI Styling Skill
12 
13Comprehensive skill for creating beautiful, accessible user interfaces combining shadcn/ui components, Tailwind CSS utility styling, and canvas-based visual design systems.
14 
15## Reference
16 
17- shadcn/ui: https://ui.shadcn.com/llms.txt
18- Tailwind CSS: https://tailwindcss.com/docs
19 
20## When to Use This Skill
21 
22Use when:
23- Building UI with React-based frameworks (Next.js, Vite, Remix, Astro)
24- Implementing accessible components (dialogs, forms, tables, navigation)
25- Styling with utility-first CSS approach
26- Creating responsive, mobile-first layouts
27- Implementing dark mode and theme customization
28- Building design systems with consistent tokens
29- Generating visual designs, posters, or brand materials
30- Rapid prototyping with immediate visual feedback
31- Adding complex UI patterns (data tables, charts, command palettes)
32 
33## Core Stack
34 
35### Component Layer: shadcn/ui
36- Pre-built accessible components via Radix UI primitives
37- Copy-paste distribution model (components live in your codebase)
38- TypeScript-first with full type safety
39- Composable primitives for complex UIs
40- CLI-based installation and management
41 
42### Styling Layer: Tailwind CSS
43- Utility-first CSS framework
44- Build-time processing with zero runtime overhead
45- Mobile-first responsive design
46- Consistent design tokens (colors, spacing, typography)
47- Automatic dead code elimination
48 
49### Visual Design Layer: Canvas
50- Museum-quality visual compositions
51- Philosophy-driven design approach
52- Sophisticated visual communication
53- Minimal text, maximum visual impact
54- Systematic patterns and refined aesthetics
55 
56## Script Paths
57 
58Script paths in this skill and its `references/` are relative to the directory that contains this SKILL.md, not to the project: `scripts/<file>` is this skill's own `scripts/` folder, and `../<skill>/scripts/<file>` is a sibling sub-skill installed alongside it. Build the full path from that directory (Claude Code reports it as the skill's base directory when the skill loads) and keep the working directory at the project root — the scripts read and write project files such as `docs/brand-guidelines.md`, `assets/design-tokens.json` or `src/` relative to it.
59 
60## Quick Start
61 
62### Component + Styling Setup
63 
64**Install shadcn/ui with Tailwind:**
65```bash
66npx shadcn@latest init
67```
68 
69CLI prompts for framework, TypeScript, paths, and theme preferences. This configures both shadcn/ui and Tailwind CSS.
70 
71**Add components:**
72```bash
73npx shadcn@latest add button card dialog form
74```
75 
76**Use components with utility styling:**
77```tsx
78import { Button } from "@/components/ui/button"
79import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"
80 
81export function Dashboard() {
82 return (
83 <div className="container mx-auto p-6 grid gap-6 md:grid-cols-2 lg:grid-cols-3">
84 <Card className="hover:shadow-lg transition-shadow">
85 <CardHeader>
86 <CardTitle className="text-2xl font-bold">Analytics</CardTitle>
87 </CardHeader>
88 <CardContent className="space-y-4">
89 <p className="text-muted-foreground">View your metrics</p>
90 <Button variant="default" className="w-full">
91 View Details
92 </Button>
93 </CardContent>
94 </Card>
95 </div>
96 )
97}
98```
99 
100### Alternative: Tailwind-Only Setup
101 
102**Vite projects:**
103```bash
104npm install -D tailwindcss @tailwindcss/vite
105```
106 
107```javascript
108// vite.config.ts
109import tailwindcss from '@tailwindcss/vite'
110export default { plugins: [tailwindcss()] }
111```
112 
113```css
114/* src/index.css */
115@import "tailwindcss";
116```
117 
118## Component Library Guide
119 
120**Comprehensive component catalog with usage patterns, installation, and composition examples.**
121 
122See: `references/shadcn-components.md`
123 
124Covers:
125- Form & input components (Button, Input, Select, Checkbox, Date Picker, Form validation)
126- Layout & navigation (Card, Tabs, Accordion, Navigation Menu)
127- Overlays & dialogs (Dialog, Drawer, Popover, Toast, Command)
128- Feedback & status (Alert, Progress, Skeleton)
129- Display components (Table, Data Table, Avatar, Badge)
130 
131## Theme & Customization
132 
133**Theme configuration, CSS variables, dark mode implementation, and component customization.**
134 
135See: `references/shadcn-theming.md`
136 
137Covers:
138- Dark mode setup with next-themes
139- CSS variable system
140- Color customization and palettes
141- Component variant customization
142- Theme toggle implementation
143 
144## Accessibility Patterns
145 
146**ARIA patterns, keyboard navigation, screen reader support, and accessible component usage.**
147 
148See: `references/shadcn-accessibility.md`
149 
150Covers:
151- Radix UI accessibility features
152- Keyboard navigation patterns
153- Focus management
154- Screen reader announcements
155- Form validation accessibility
156 
157## Tailwind Utilities
158 
159**Core utility classes for layout, spacing, typography, colors, borders, and shadows.**
160 
161See: `references/tailwind-utilities.md`
162 
163Covers:
164- Layout utilities (Flexbox, Grid, positioning)
165- Spacing system (padding, margin, gap)
166- Typography (font sizes, weights, alignment, line height)
167- Colors and backgrounds
168- Borders and shadows
169- Arbitrary values for custom styling
170 
171## Responsive Design
172 
173**Mobile-first breakpoints, responsive utilities, and adaptive layouts.**
174 
175See: `references/tailwind-responsive.md`
176 
177Covers:
178- Mobile-first approach
179- Breakpoint system (sm, md, lg, xl, 2xl)
180- Responsive utility patterns
181- Container queries
182- Max-width queries
183- Custom breakpoints
184 
185## Tailwind Customization
186 
187**Config file structure, custom utilities, plugins, and theme extensions.**
188 
189See: `references/tailwind-customization.md`
190 
191Covers:
192- @theme directive for custom tokens
193- Custom colors and fonts
194- Spacing and breakpoint extensions
195- Custom utility creation
196- Custom variants
197- Layer organization (@layer base, components, utilities)
198- Apply directive for component extraction
199 
200## Visual Design System
201 
202**Canvas-based design philosophy, visual communication principles, and sophisticated compositions.**
203 
204See: `references/canvas-design-system.md`
205 
206Covers:
207- Design philosophy approach
208- Visual communication over text
209- Systematic patterns and composition
210- Color, form, and spatial design
211- Minimal text integration
212- Museum-quality execution
213- Multi-page design systems
214 
215## Utility Scripts
216 
217**Python automation for component installation and configuration generation.**
218 
219### shadcn_add.py
220Add shadcn/ui components with dependency handling:
221```bash
222python scripts/shadcn_add.py button card dialog
223```
224 
225### tailwind_config_gen.py
226Generate tailwind.config.js with custom theme:
227```bash
228python scripts/tailwind_config_gen.py --colors brand:blue --fonts display:Inter
229```
230 
231The generator refuses to create or replace a config when any sibling
232`tailwind.config.js`, `.cjs`, `.mjs`, or `.ts` file already exists. Review the
233reported config first, then pass `--force` only when the competing output is
234intentional:
235```bash
236python scripts/tailwind_config_gen.py --colors brand:blue --force
237```
238 
239## Best Practices
240 
2411. **Component Composition**: Build complex UIs from simple, composable primitives
2422. **Utility-First Styling**: Use Tailwind classes directly; extract components only for true repetition
2433. **Mobile-First Responsive**: Start with mobile styles, layer responsive variants
2444. **Accessibility-First**: Leverage Radix UI primitives, add focus states, use semantic HTML
2455. **Design Tokens**: Use consistent spacing scale, color palettes, typography system
2466. **Dark Mode Consistency**: Apply dark variants to all themed elements
2477. **Performance**: Leverage automatic CSS purging, avoid dynamic class names
2488. **TypeScript**: Use full type safety for better DX
2499. **Visual Hierarchy**: Let composition guide attention, use spacing and color intentionally
25010. **Expert Craftsmanship**: Every detail matters - treat UI as a craft
251 
252## Reference Navigation
253 
254**Component Library**
255- `references/shadcn-components.md` - Complete component catalog
256- `references/shadcn-theming.md` - Theming and customization
257- `references/shadcn-accessibility.md` - Accessibility patterns
258 
259**Styling System**
260- `references/tailwind-utilities.md` - Core utility classes
261- `references/tailwind-responsive.md` - Responsive design
262- `references/tailwind-customization.md` - Configuration and extensions
263 
264**Visual Design**
265- `references/canvas-design-system.md` - Design philosophy and canvas workflows
266 
267**Automation**
268- `scripts/shadcn_add.py` - Component installation
269- `scripts/tailwind_config_gen.py` - Config generation
270 
271## Common Patterns
272 
273**Form with validation:**
274```tsx
275import { useForm } from "react-hook-form"
276import { zodResolver } from "@hookform/resolvers/zod"
277import * as z from "zod"
278import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from "@/components/ui/form"
279import { Input } from "@/components/ui/input"
280import { Button } from "@/components/ui/button"
281 
282const schema = z.object({
283 email: z.string().email(),
284 password: z.string().min(8)
285})
286 
287export function LoginForm() {
288 const form = useForm({
289 resolver: zodResolver(schema),
290 defaultValues: { email: "", password: "" }
291 })
292 
293 return (
294 <Form {...form}>
295 <form onSubmit={form.handleSubmit(console.log)} className="space-y-6">
296 <FormField control={form.control} name="email" render={({ field }) => (
297 <FormItem>
298 <FormLabel>Email</FormLabel>
299 <FormControl>
300 <Input type="email" {...field} />
301 </FormControl>
302 <FormMessage />
303 </FormItem>
304 )} />
305 <Button type="submit" className="w-full">Sign In</Button>
306 </form>
307 </Form>
308 )
309}
310```
311 
312**Responsive layout with dark mode:**
313```tsx
314<div className="min-h-screen bg-white dark:bg-gray-900">
315 <div className="container mx-auto px-4 py-8">
316 <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
317 <Card className="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700">
318 <CardContent className="p-6">
319 <h3 className="text-xl font-semibold text-gray-900 dark:text-white">
320 Content
321 </h3>
322 </CardContent>
323 </Card>
324 </div>
325 </div>
326</div>
327```
328 
329## Resources
330 
331- shadcn/ui Docs: https://ui.shadcn.com
332- Tailwind CSS Docs: https://tailwindcss.com
333- Radix UI: https://radix-ui.com
334- Tailwind UI: https://tailwindui.com
335- Headless UI: https://headlessui.com
336- v0 (AI UI Generator): https://v0.dev
337 

Discussion

Alternatives

Animation vocabularyReverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.Design & UI · MITModern web guidanceSearch tool for modern web development best practices. MANDATORY: Execute FIRST for all HTML/CSS and clientside JS tasks. Do NOT skip — web APIs evolve rapidly and training weights contain obsolete patterns. Trigger immediately for: - UI/Layout: Modals, dialogs, popovers, Glassmorphism/backdrop-filters, anchor positioning, container queries, `:has()`, `:user-valid`. - Scroll/Motion: View Transitions, Scroll-driven animations, scroll parallax/reveals. - Performance: CWV (LCP, INP), content-visibility, Fetch Priority, image optimization. - System/APIs: Local filesystem access, WebUSB, WebSockets sync, WebAssembly widgets. - Frameworks: Adapting layout/styles in React, Vue, Angular. - General Frontend: Forms, autofill, advanced inputs, custom scrollbars, modern component states, etc. DO NOT trigger for: - Backend: Database SQL, ORMs, Express API routes. - Pipelines: CI/CD deployment, Docker, Actions. - Generic: Local scripts (Python/Go tools), ESLint, Git.Coding · Apache-2.0Playwright BrowserHeadless, reproducible browser automation with Playwright for any project — screenshots of web pages or local dev servers (desktop/tablet/mobile, full page or one element, single page or every page/menu of an app in one batch), frontend audits (console errors, failed requests, broken images/links, responsive overflow, axe accessibility, LCP/CLS performance), before/after visual comparison, scripted E2E flows (log in, click, fill, page through, assert), and logged-in pages via saved sessions. Use this whenever the user wants to screenshot or visually check a site, find frontend bugs, see how a page looks on mobile, compare the UI before and after a CSS/code change, reproduce a bug from an issue or ticket and capture evidence images for it, verify a UI flow works, or run/write a browser test — even if they never say "Playwright" or "browser". If Claude in Chrome could also do the job, briefly ask which to use (with a recommendation) instead of silently picking.Coding · MITAct as an electron frontend developerGuide users in building a desktop application using Electron with a focus on frontend development best practices.Coding · CC0-1.0