Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
AI-powered UI styling skill with 67 UI styles and 161 reasoning rules for professional interface design.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: ckm:ui-styling3description: 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: MIT6metadata:7author: claudekit8version: "1.0.0"9---1011# UI Styling Skill1213Comprehensive skill for creating beautiful, accessible user interfaces combining shadcn/ui components, Tailwind CSS utility styling, and canvas-based visual design systems.1415## Reference1617- shadcn/ui: https://ui.shadcn.com/llms.txt18- Tailwind CSS: https://tailwindcss.com/docs1920## When to Use This Skill2122Use 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 approach26- Creating responsive, mobile-first layouts27- Implementing dark mode and theme customization28- Building design systems with consistent tokens29- Generating visual designs, posters, or brand materials30- Rapid prototyping with immediate visual feedback31- Adding complex UI patterns (data tables, charts, command palettes)3233## Core Stack3435### Component Layer: shadcn/ui36- Pre-built accessible components via Radix UI primitives37- Copy-paste distribution model (components live in your codebase)38- TypeScript-first with full type safety39- Composable primitives for complex UIs40- CLI-based installation and management4142### Styling Layer: Tailwind CSS43- Utility-first CSS framework44- Build-time processing with zero runtime overhead45- Mobile-first responsive design46- Consistent design tokens (colors, spacing, typography)47- Automatic dead code elimination4849### Visual Design Layer: Canvas50- Museum-quality visual compositions51- Philosophy-driven design approach52- Sophisticated visual communication53- Minimal text, maximum visual impact54- Systematic patterns and refined aesthetics5556## Quick Start5758### Component + Styling Setup5960**Install shadcn/ui with Tailwind:**61```bash62npx shadcn@latest init63```6465CLI prompts for framework, TypeScript, paths, and theme preferences. This configures both shadcn/ui and Tailwind CSS.6667**Add components:**68```bash69npx shadcn@latest add button card dialog form70```7172**Use components with utility styling:**73```tsx74import { Button } from "@/components/ui/button"75import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"7677export function Dashboard() {78return (79<div className="container mx-auto p-6 grid gap-6 md:grid-cols-2 lg:grid-cols-3">80<Card className="hover:shadow-lg transition-shadow">81<CardHeader>82<CardTitle className="text-2xl font-bold">Analytics</CardTitle>83</CardHeader>84<CardContent className="space-y-4">85<p className="text-muted-foreground">View your metrics</p>86<Button variant="default" className="w-full">87View Details88</Button>89</CardContent>90</Card>91</div>92)93}94```9596### Alternative: Tailwind-Only Setup9798**Vite projects:**99```bash100npm install -D tailwindcss @tailwindcss/vite101```102103```javascript104// vite.config.ts105import tailwindcss from '@tailwindcss/vite'106export default { plugins: [tailwindcss()] }107```108109```css110/* src/index.css */111@import "tailwindcss";112```113114## Component Library Guide115116**Comprehensive component catalog with usage patterns, installation, and composition examples.**117118See: `references/shadcn-components.md`119120Covers:121- Form & input components (Button, Input, Select, Checkbox, Date Picker, Form validation)122- Layout & navigation (Card, Tabs, Accordion, Navigation Menu)123- Overlays & dialogs (Dialog, Drawer, Popover, Toast, Command)124- Feedback & status (Alert, Progress, Skeleton)125- Display components (Table, Data Table, Avatar, Badge)126127## Theme & Customization128129**Theme configuration, CSS variables, dark mode implementation, and component customization.**130131See: `references/shadcn-theming.md`132133Covers:134- Dark mode setup with next-themes135- CSS variable system136- Color customization and palettes137- Component variant customization138- Theme toggle implementation139140## Accessibility Patterns141142**ARIA patterns, keyboard navigation, screen reader support, and accessible component usage.**143144See: `references/shadcn-accessibility.md`145146Covers:147- Radix UI accessibility features148- Keyboard navigation patterns149- Focus management150- Screen reader announcements151- Form validation accessibility152153## Tailwind Utilities154155**Core utility classes for layout, spacing, typography, colors, borders, and shadows.**156157See: `references/tailwind-utilities.md`158159Covers:160- Layout utilities (Flexbox, Grid, positioning)161- Spacing system (padding, margin, gap)162- Typography (font sizes, weights, alignment, line height)163- Colors and backgrounds164- Borders and shadows165- Arbitrary values for custom styling166167## Responsive Design168169**Mobile-first breakpoints, responsive utilities, and adaptive layouts.**170171See: `references/tailwind-responsive.md`172173Covers:174- Mobile-first approach175- Breakpoint system (sm, md, lg, xl, 2xl)176- Responsive utility patterns177- Container queries178- Max-width queries179- Custom breakpoints180181## Tailwind Customization182183**Config file structure, custom utilities, plugins, and theme extensions.**184185See: `references/tailwind-customization.md`186187Covers:188- @theme directive for custom tokens189- Custom colors and fonts190- Spacing and breakpoint extensions191- Custom utility creation192- Custom variants193- Layer organization (@layer base, components, utilities)194- Apply directive for component extraction195196## Visual Design System197198**Canvas-based design philosophy, visual communication principles, and sophisticated compositions.**199200See: `references/canvas-design-system.md`201202Covers:203- Design philosophy approach204- Visual communication over text205- Systematic patterns and composition206- Color, form, and spatial design207- Minimal text integration208- Museum-quality execution209- Multi-page design systems210211## Utility Scripts212213**Python automation for component installation and configuration generation.**214215### shadcn_add.py216Add shadcn/ui components with dependency handling:217```bash218python scripts/shadcn_add.py button card dialog219```220221### tailwind_config_gen.py222Generate tailwind.config.js with custom theme:223```bash224python scripts/tailwind_config_gen.py --colors brand:blue --fonts display:Inter225```226227## Best Practices2282291. **Component Composition**: Build complex UIs from simple, composable primitives2302. **Utility-First Styling**: Use Tailwind classes directly; extract components only for true repetition2313. **Mobile-First Responsive**: Start with mobile styles, layer responsive variants2324. **Accessibility-First**: Leverage Radix UI primitives, add focus states, use semantic HTML2335. **Design Tokens**: Use consistent spacing scale, color palettes, typography system2346. **Dark Mode Consistency**: Apply dark variants to all themed elements2357. **Performance**: Leverage automatic CSS purging, avoid dynamic class names2368. **TypeScript**: Use full type safety for better DX2379. **Visual Hierarchy**: Let composition guide attention, use spacing and color intentionally23810. **Expert Craftsmanship**: Every detail matters - treat UI as a craft239240## Reference Navigation241242**Component Library**243- `references/shadcn-components.md` - Complete component catalog244- `references/shadcn-theming.md` - Theming and customization245- `references/shadcn-accessibility.md` - Accessibility patterns246247**Styling System**248- `references/tailwind-utilities.md` - Core utility classes249- `references/tailwind-responsive.md` - Responsive design250- `references/tailwind-customization.md` - Configuration and extensions251252**Visual Design**253- `references/canvas-design-system.md` - Design philosophy and canvas workflows254255**Automation**256- `scripts/shadcn_add.py` - Component installation257- `scripts/tailwind_config_gen.py` - Config generation258259## Common Patterns260261**Form with validation:**262```tsx263import { useForm } from "react-hook-form"264import { zodResolver } from "@hookform/resolvers/zod"265import * as z from "zod"266import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from "@/components/ui/form"267import { Input } from "@/components/ui/input"268import { Button } from "@/components/ui/button"269270const schema = z.object({271email: z.string().email(),272password: z.string().min(8)273})274275export function LoginForm() {276const form = useForm({277resolver: zodResolver(schema),278defaultValues: { email: "", password: "" }279})280281return (282<Form {...form}>283<form onSubmit={form.handleSubmit(console.log)} className="space-y-6">284<FormField control={form.control} name="email" render={({ field }) => (285<FormItem>286<FormLabel>Email</FormLabel>287<FormControl>288<Input type="email" {...field} />289</FormControl>290<FormMessage />291</FormItem>292)} />293<Button type="submit" className="w-full">Sign In</Button>294</form>295</Form>296)297}298```299300**Responsive layout with dark mode:**301```tsx302<div className="min-h-screen bg-white dark:bg-gray-900">303<div className="container mx-auto px-4 py-8">304<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">305<Card className="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700">306<CardContent className="p-6">307<h3 className="text-xl font-semibold text-gray-900 dark:text-white">308Content309</h3>310</CardContent>311</Card>312</div>313</div>314</div>315```316317## Resources318319- shadcn/ui Docs: https://ui.shadcn.com320- Tailwind CSS Docs: https://tailwindcss.com321- Radix UI: https://radix-ui.com322- Tailwind UI: https://tailwindui.com323- Headless UI: https://headlessui.com324- v0 (AI UI Generator): https://v0.dev325