Skip to content
Skills Library
Design & UX · Building & coding

refactoring-ui

/refactoring-ui

Professional UI design principles using Tailwind CSS and shadcn/ui. Use this skill when creating web interfaces, React components, HTML layouts, landing pages, dashboards, or any visual UI work. Applies Refactoring UI principles via Tailwind utilities and shadcn components for polished, professional designs. Triggers when building UI components, styling interfaces, creating layouts, designing forms, or when user wants something to look better or more professional.

Licence
MIT
Last repository change
19.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
10
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 19.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Professional UI design principles using Tailwind CSS and shadcn/ui. Use this skill when creating web interfaces, React components, HTML layouts, landing pages, dashboards, or any visual UI work. Applies Refactoring UI principles via Tailwind utilities and shadcn components for polished, professional designs. Triggers when building UI components, styling interfaces, creating layouts, designing forms, or when user wants something to look better or more professional.

Original author description

Professional UI design principles using Tailwind CSS and shadcn/ui. Use this skill when creating web interfaces, React components, HTML layouts, landing pages, dashboards, or any visual UI work. Applies Refactoring UI principles via Tailwind utilities and shadcn components for polished, professional designs. Triggers when building UI components, styling interfaces, creating layouts, designing forms, or when user wants something to look better or more professional.

How it works

  1. Context Matters: Identify Your Project Type
  2. Core Principles
  3. Topic References
  4. Quick Start with shadcn/ui
  5. Button Hierarchy (shadcn)
  6. Common Patterns
  7. Anti-Patterns
  8. Quick Decision: Modal vs Sheet vs Page
  9. Quick Decision: Confirmation Pattern
Original SKILL.md headings · 177 lines, 758 words
SKILL.md preview
---
name: refactoring-ui
description: Professional UI design principles using Tailwind CSS and shadcn/ui. Use this skill when creating web interfaces, React components, HTML layouts, landing pages, dashboards, or any visual UI work. Applies Refactoring UI principles via Tailwind utilities and shadcn components for polished, professional designs. Triggers when building UI components, styling interfaces, creating layouts, designing forms, or when user wants something to look better or more professional.
---

# Refactoring UI with Tailwind + shadcn/ui

Apply professional design principles using Tailwind's design system and shadcn/ui components.

## Context Matters: Identify Your Project Type

Different contexts require different design approaches. Before applying patterns, identify your context:

| Aspect | Marketing/Landing | SaaS/Admin Dashboard |
|--------|-------------------|---------------------|
| **Goal** | Convert visitors | Enable productivity |
| **Users** | First-time visitors | Repeated daily use |
| **Forms** | Minimal (2-4 fields) | Complex multi-field |
| **Layout** | Single-column only | Multi-column OK |
| **Errors** | Prevent abandonment | Offer undo/recovery |

**Quick decision:** Is the user here once or daily? Once → optimize for conversion. Daily → optimize for efficiency.

See **[saas-patterns.md](references/saas-patterns.md)** for SaaS-specific patterns: modals vs sheets vs pages, confirmation dialogs, CRUD tables, empty states, and loading patterns.

## Core Principles

1. **Start with functionality, not chrome** - Design the feature first, not the shell
2. **Work in grayscale first** - Add color only after hierarchy is established
3. **Use existing systems** - Tailwind scale + shadcn components, don't reinvent
4. **Hierarchy is everything** - Not all elements deserve equal emphasis

## Topic References

### Foundation
- **[shadcn.md](references/shadcn.md)** - Component patterns, composition, customization
- **[hierarchy.md](references/hierarchy.md)** - Visual hierarchy, emphasis, contrast
- **[spacing.md](references/spacing.md)** - Layout, whitespace, sizing
- **[typography.md](references/typography.md)** - Type scales, fonts, line-height
- **[color.md](references/color.md)** - Palettes, shades, accessibility
- **[depth.md](references/depth.md)** - Shadows, elevation, layering
- **[polish.md](references/polish.md)** - Finishing touches, borders, backgrounds

### Specialized
- **[forms.md](references/forms.md)** - Form design, validation, multi-step, mobile optimization
- **[saas-patterns.md](references/saas-patterns.md)** - Modal/sheet/page decisions, confirmations, CRUD tables, lists, empty states

## Quick Start with shadcn/ui

### Installation (Next.js)
```bash
npx shadcn@latest init
npx shadcn@latest add button card input label
```

### Core Components to Know

| Component | Use for |
|-----------|---------|
| `Button` | Actions with built-in variants (default, secondary, outline, ghost, destructive) |
| `Card` | Content containers with header, content, footer |
| `Input` + `Label` | Form fields with consistent styling |
| `Dialog` | Modals with accessible focus management |
| `DropdownMenu` | Actions menus with keyboard navigation |
| `Select` | Styled native-like selects |
| `Tabs` | Content organization |
| `Badge` | Status indicators, counts |
| `Alert` | Feedback messages |
| `Skeleton` | Loading states |

## Button Hierarchy (shadcn)

```tsx
// Primary: one per section max
<Button>Save Changes</Button>

// Secondary: clear but not dominant
<Button variant="secondary">Cancel</Button>

// Outline: lighter touch
<Button variant="outline">Edit</Button>

// Ghost: minimal, for toolbars/nav
<Button variant="ghost">Settings</Button>

// Destructive: dangerous actions (use sparingly)
<Button variant="destructive">Delete</Button>

// Link: text-only navigation
<Button variant="link">Learn more</Button>
```

## Common Patterns

### Card with Hierarchy
```tsx
<Card>
  <CardHeader>
    <CardTitle>Account Settings</CardTitle>
    <CardDescription>Manage your account preferences.</CardDescription>
  </CardHeader>
  <CardContent className="space-y-4">
    {/* Form fields */}
  </CardContent>
  <CardFooter className="flex justify-end gap-2">
    <Button variant="outline">Cancel</Button>
    <Button>Save</Button>
  </CardFooter>
</Card>
```

### Form with Labels
```tsx
// Single-column layout (always preferred)
<form className="space-y-6 max-w-md">
  <div className="space-y-2">
    <Label htmlFor="email">Email</Label>
    <Input id="email" type="email" placeholder="you@example.com" />
  </div>
  <div className="space-y-2">
    <Label htmlFor="password">Password</Label>
    <Input id="password" type="password" />
    <p className="text-sm text-muted-foreground">At least 8 characters</p>
  </div>
  <Button type="submit" className="w-full">Sign In</Button>
</form>
```

See **[forms.md](references/forms.md)** for multi-step forms, validation, and mobile optimization.

### Alert Messages
```tsx
<Alert>
  <InfoIcon className="h-4 w-4" />
  <AlertTitle>Note</AlertTitle>
  <AlertDescription>Your session will expire in 5 minutes.</AlertDescription>
</Alert>

<Alert variant="destructive">
  <AlertCircle className="h-4 w-4" />
  <AlertTitle>Error</AlertTitle>
  <AlertDescription>Failed to save changes.</AlertDescription>
</Alert>
```

## Anti-Patterns

- ❌ Multiple primary buttons in one view
- ❌ `variant="destructive"` for non-destructive actions
- ❌ Skipping `Label` components (accessibility)
- ❌ Overriding shadcn styles instead of using variants
- ❌ Not using `space-y-*` or `gap-*` for consistent spacing
- ❌ Arbitrary Tailwind values like `w-[423px]` (use scale)
- ❌ Grey text on colored backgrounds (use same-hue shades)
- ❌ **Long forms in sheets/drawers** — Forms with >5 fields or that scroll belong on a full page
- ❌ **Scrolling modals/sheets** — If content scrolls, the container is wrong

## Quick Decision: Modal vs Sheet vs Page

```
Is this a confirmation/alert? → Modal
Need to reference background content? → Sheet/Drawer (but NOT for long forms)
Complex form (>5 fields)? → Full Page (NEVER sheet/drawer)
Form scrolls or has sections? → Full Page
Quick edit (1-3 fields)? → Inline or small Modal
Settings/filters panel? → Drawer
```

**⚠️ Common mistake:** Putting long forms in sheets/drawers. If the form scrolls, has >5 fields, or has multiple sections, use a full page instead.

## Quick Decision: Confirmation Pattern

```
Easily undone (archive, tag)? → Toast with undo
Moderate impact (delete draft)? → Simple modal
High impact (remove user)? → Modal with consequences
Irreversible (delete account)? → Type-to-confirm
```

See **[saas-patterns.md](references/saas-patterns.md)** for full decision frameworks and code examples.
Files in this package (10)
  • SKILL.md 7 KB
  • references/color.md 4 KB
  • references/depth.md 5 KB
  • references/forms.md 19 KB
  • references/hierarchy.md 4 KB
  • references/polish.md 9 KB
  • references/saas-patterns.md 24 KB
  • references/shadcn.md 11 KB
  • references/spacing.md 4 KB
  • references/typography.md 4 KB

Versions

RepositoryScoreLicence
This page · opkod-france/opkod-claude-code-plugins100MIT
wondelai/skills100MIT
ZTR66/dsh-design-library91MIT

Database snapshot: 13.11.2026 · package version e8bf2d5b554d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100tailwind-design-system
    Skill for creating and managing a Design System using Tailwind CSS and shadcn/ui. Use when defining design tokens, setting up theming with CSS variables, building a consistent UI component library, initializing a design system configuration, or wrapping shadcn/ui components into…
  • 100ui-styling
    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…
  • 100ui-styling
    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…
  • 100ui-styling
    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…
  • 100frontend-react
    Professional React development skill covering Next.js, React Server Components, Tailwind CSS, and the React ecosystem. Use this skill when building modern React applications, implementing Next.js features, creating UI components with shadcn/ui, or working with complex state management.
  • 100frontend-react
    Professional React development skill covering Next.js, React Server Components, Tailwind CSS, and the React ecosystem. Use this skill when building modern React applications, implementing Next.js features, creating UI components with shadcn/ui, or working with complex state management.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.