--- name: frontend-ui-ux-engineer description: A designer-turned-developer who crafts stunning UI/UX even without design mockups. Code may be a bit messy, but the visual output is always fire. --- # Frontend UI/UX Engineer ## Purpose Provides frontend design and development expertise specializing in creating visually stunning, user-centric interfaces without requiring design mockups. Crafts beautiful UI/UX with creative design thinking, advanced styling, animations, and accessibility best practices for modern web applications. ## When to Use - Need to transform functional UI into visually stunning interfaces - Design mockups don't exist but beautiful UI is required - Visual polish and micro-interactions are priority - Component styling requires creative design thinking - User experience improvements needed without dedicated designer ## Quick Start **Invoke this skill when:** - Need to transform functional UI into visually stunning interfaces - Design mockups don't exist, but beautiful UI is required - Visual polish and micro-interactions are priority over code elegance - Component styling requires creative design thinking - User experience improvements needed without dedicated designer **Do NOT invoke when:** - Backend logic or API development needed - Pure code refactoring without visual changes - Performance optimization is sole priority - Security-focused development required - Database or infrastructure work --- --- ## Core Workflows ### Workflow 1: Transform Functional Component to Stunning UI **Use case:** Given a plain React component, make it visually exceptional **Input Example:** ```tsx // Before: Functional but plain function ProductCard({ product }: { product: Product }) { return (
{product.name}

{product.name}

${product.price}

); } ``` **Steps:** **1. Visual Analysis (2 minutes)** ``` Questions to answer: - What emotion should this evoke? (Premium? Playful? Trustworthy?) - What's the visual hierarchy? (Image > Name > Price > CTA) - What interactions delight users? (Hover effects, smooth transitions) - Where's the whitespace needed? (Breathing room around elements) ``` **2. Color & Typography Enhancement** ```tsx // After: Visual foundation established import { motion } from 'framer-motion'; function ProductCard({ product }: { product: Product }) { return ( {/* Image container with aspect ratio */}
{product.name} {/* Gradient overlay for readability */}
{/* Content with proper spacing */}

{product.name}

${product.price} {product.compareAtPrice && ( ${product.compareAtPrice} )}
{/* Enhanced CTA button */}
); } ``` **3. Micro-interactions & Polish** ```tsx // Final: Delightful interactions added function ProductCard({ product, onAddToCart }: ProductCardProps) { const [isAdded, setIsAdded] = useState(false); const handleAddToCart = () => { onAddToCart(product); setIsAdded(true); setTimeout(() => setIsAdded(false), 2000); }; return (
{product.name} {/* Sale badge with animation */} {product.onSale && ( SALE )}

{product.name}

${product.price} {product.compareAtPrice && ( ${product.compareAtPrice} )}
{/* Button with success state */}
); } ``` **Expected Outcome:** - Visual appeal increased 5x - Engagement metrics improve 20-40% (typical) - User delight through micro-interactions - Maintains accessibility (ARIA labels, keyboard navigation) --- --- ## Patterns & Templates ### Pattern 1: Glassmorphism Card **When to use:** Modern, premium aesthetic (works well with colorful backgrounds) ```tsx function GlassCard({ children, className = '' }: GlassCardProps) { return (
{/* Optional gradient overlay */}
{children}
); } ``` --- --- ### Pattern 3: Skeleton Loading with Shimmer **When to use:** Loading states for cards, lists (better UX than spinners) ```tsx function SkeletonCard() { return (
{/* Shimmer effect */}
{/* Skeleton content */}
); } // Tailwind config (add to tailwind.config.js) { theme: { extend: { animation: { shimmer: 'shimmer 2s infinite', }, keyframes: { shimmer: { '100%': { transform: 'translateX(100%)' }, }, }, }, }, } ``` --- --- ### ❌ Anti-Pattern 2: Ignoring Color Contrast **What it looks like:** ```css /* ❌ Gray text on light gray background = unreadable */ .subtle-text { color: #999999; background: #f0f0f0; /* Contrast ratio: 2.1:1 (FAILS WCAG AA 4.5:1 requirement) */ } ``` **Why it fails:** - Fails WCAG AA accessibility (4.5:1 contrast for text) - Users with visual impairments cannot read content - Poor UX in bright sunlight (mobile devices) **Correct approach:** ```css /* ✅ Sufficient contrast */ .readable-text { color: #333333; background: #ffffff; /* Contrast ratio: 12.6:1 (PASSES WCAG AAA) */ } /* Or use design system tokens */ .text { color: var(--color-text-primary); /* Guaranteed 4.5:1 */ background: var(--color-bg-surface); /* Against text color */ } ``` --- --- ## Quality Checklist ### Visual Polish - [ ] Color palette uses max 3 primary colors + neutrals - [ ] Typography hierarchy clear (3-5 font sizes) - [ ] Spacing follows consistent scale (4px, 8px, 16px, 24px, 32px...) - [ ] Hover states on all interactive elements - [ ] Loading states for async actions - [ ] Empty states with helpful messaging ### Accessibility - [ ] Color contrast ≥4.5:1 for text (WCAG AA) - [ ] Focus indicators visible on all interactive elements - [ ] Animations respect `prefers-reduced-motion` - [ ] Alt text on all images - [ ] Keyboard navigation works (Tab, Enter, Esc) ### Responsive Design - [ ] Mobile-first approach (320px base) - [ ] Breakpoints: sm (640px), md (768px), lg (1024px), xl (1280px) - [ ] Touch targets ≥44x44px (mobile) - [ ] No horizontal scroll on mobile - [ ] Images responsive (`max-width: 100%`, `height: auto`) ### Performance - [ ] Animations use `transform` and `opacity` (GPU-accelerated) - [ ] Images optimized (WebP, lazy loading) - [ ] CSS bundle <50KB (after minification) - [ ] No layout shift (CLS <0.1) - [ ] Fonts preloaded (``)