Modernize frontend codebases into production-grade interfaces using shadcn/ui, Tailwind CSS, and Radix UI. Covers design tokens, component architecture, loading/progress feedback patterns, accessibility, dark mode, and responsive design. Trigger with "modernize the UI", "ui refactor", "migrate to shadcn", "fix the design system", "add loading states", "progress feedback", "make it look modern", or when someone needs help with frontend component architecture, design tokens, or async feedback patterns.
Instalação
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Modernize frontend codebases into production-grade interfaces using shadcn/ui, Tailwind CSS, and Radix UI. Covers design tokens, component architecture, loading/progress feedback patterns, accessibility, dark mode, and responsive design. Trigger with "modernize the UI", "ui refactor", "migrate to shadcn", "fix the design system", "add loading states", "progress feedback", "make it look modern", or when someone needs help with frontend component architecture, design tokens, or async feedback patterns.
when_to_use
Modernizing a frontend with shadcn/ui, Tailwind CSS, and Radix UI; establishing design tokens, component architecture, and progress feedback patterns; refactoring UI for accessibility, dark mode, and responsive design; building loading, empty, and error states with consistent interaction states
allowed-tools
Read, Glob, Grep, Bash
Frontend UI/UX Design System
A complete methodology for building and refactoring frontends into modern, consistent, accessible interfaces using shadcn/ui components, Tailwind CSS, and Radix UI primitives.
1. Design Philosophy
Core Principles
Consistency Is Trust: Every element behaves predictably. Same actions produce same patterns. Same feedback for same operations. Same spacing, typography, interaction model - everywhere.
Clarity Over Cleverness: The user never guesses what something does, where they are, or what happened. Every screen answers: "Where am I?", "What can I do?", "What just happened?"
Progressive Disclosure: Show only what's needed. Use collapsible sections, tabs, drawers, and multi-step flows to manage density.
Feedback Is Mandatory: Every user action produces immediate, visible feedback. Every click, submit, navigation, async operation. If the system is thinking, the user knows. Succeeded? They know. Failed? They know what went wrong and what to do.
Accessibility Is Non-Negotiable: WCAG 2.1 AA minimum. Keyboard navigation, screen reader support, ARIA labels, color contrast, focus management, reduced-motion support.
Mobile-First, Responsive Always: Design for 320px first, enhance upward. Functional and attractive from 320px to 2560px.
Performance Is a Feature: Lazy-load heavy components, code-split routes, optimize images. Skeletons > spinners (they communicate structure). Perceived performance matters as much as actual.
Material Design Alignment (Without Material Dependency)
Apply these principles using shadcn/ui + Tailwind only - no Material UI imports:
No inline styles - Tailwind only, theme tokens only
Export both the component and its props type
5. Visual Consistency
Typography
Strict type scale: text-xs through text-4xl - never deviate
Headings: font-semibold or font-bold. Body: font-normal. Labels: font-medium
text-foreground for primary, text-muted-foreground for secondary, text-destructive for errors
Iconography
One library everywhere: Lucide React (included with shadcn/ui)
Consistent sizing per context: 16px compact/inline, 20px standard, 24px prominent
Icons alone must have aria-label or sr-only text
Never mix icon libraries
Interaction States
Every interactive element must have all six states:
State
Treatment
Default
Base styling
Hover
Subtle background shift or shadow. Never change layout
Focus
Visible ring: ring-2 ring-ring ring-offset-2
Active/Pressed
Slight scale active:scale-[0.98] or darkened background
Disabled
opacity-50, cursor-not-allowed, no hover
Loading
Replace content with spinner or skeleton. Maintain dimensions
6. Progress Feedback System
Users must never stare at a frozen screen. Every non-instant operation communicates progress.
Three Feedback Tiers
Tier
Latency
Pattern
Tier 1: Instant
< 300ms
Optimistic UI + toast confirmation
Tier 2: Brief
300ms - 3s
Button loading state, skeletons, inline progress
Tier 3: Extended
> 3s
Full progress modal with step detail and ETA
Tier 1: Instant (< 300ms)
For toggles, simple saves, navigation:
Optimistic updates: Change UI immediately, rollback on failure
Toast confirmation: Sonner - success auto-dismisses in 3s, errors persist with retry action
Micro-animation: Button checkmark, smooth toggle, card animate into list
Tier 2: Brief (300ms - 3s)
For API fetches, form submissions, small uploads:
Button loading state:
Width must not change between states (use min-w-*)
Text describes the action: "Save" -> "Saving...", "Delete" -> "Deleting..."
Spinner replaces icon, not text
All other inputs disabled during submission
Skeleton loading:
Layout exactly matches real content dimensions - no layout shift on load
Shapes match content type: circles for avatars, bars for text, rectangles for images
If loading exceeds 5s, transition to Tier 3
Inline progress: For determinate operations like file uploads - show percentage and progress bar.
Tier 3: Extended (> 3s)
For bulk processing, report generation, multi-step workflows, AI operations, imports/exports.
The progress modal must communicate:
What is happening - operation name and description
Where we are - current step
How far - percentage or step count
What's done - checkmarks on finished steps
What's remaining - visible upcoming steps
How long - estimated time remaining
What went wrong - inline error per step with retry
Build this as a reusable OperationProgressModal component with a useOperationProgress hook. See the command reference for full implementation patterns.
Feedback Decision Matrix
Operation
Latency
Pattern
Toggle, checkbox, switch
Instant
Optimistic + toast
Save form (few fields)
< 1s
Button loading + toast
Save form (large)
1-3s
Button loading + inline progress
Page navigation
< 500ms
Route transition skeleton
Data table load
1-3s
Full table skeleton
Search / filter
300ms-2s
Debounce + inline skeleton
File upload (small)
1-5s
Inline progress bar
File upload (large)
5s-5m
Progress modal with speed/ETA
Report generation
3s-60s
Progress modal with steps
Bulk import/export
5s-10m
Progress modal with steps + row count
AI / ML processing
5s-5m
Progress modal with activity log
Multi-service orchestration
3s-60s
Progress modal per-service status
Background job (fire & forget)
N/A
Toast with "View progress" link
7. Error States & Empty States
Error Boundaries
Every major UI section wrapped in an error boundary that:
Catches rendering errors without crashing the app
Shows contextual error with retry option
Logs error with full context
Uses shadcn/ui Alert with variant="destructive"
Empty States
Every data-driven view has a designed empty state:
Explains why (no data yet vs. no results match filters)
Provides clear CTA ("Import first transactions", "Clear filters")