Awesome-omni-skill frontend-ui
Build beautiful, responsive UIs with React, Tailwind CSS, and Framer Motion animations.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/frontend-ui-jaivishchauhan" ~/.claude/skills/diegosouzapw-awesome-omni-skill-frontend-ui-13a455 && rm -rf "$T"
skills/development/frontend-ui-jaivishchauhan/SKILL.mdFrontend UI Development Masterclass
Core Philosophy
This skill focuses on creating "premium" web experiences. We don't just build functionality; we build feeling. Every interaction should be smooth, every layout responsive, and every aesthetic choice intentional.
Technology Stack Deep Dive
1. React Architecture & Patterns
We use React not just for components, but for state-driven UI architecture.
Component Composition Patterns
Avoid prop-drilling by using composition (children prop) and slots.
// Bad: Prop drilling <Layout userName={user.name} userAvatar={user.avatar} onLogout={handleLogout} /> // Good: Composition <Layout header={<Header user={user} onLogout={handleLogout} />} sidebar={<Sidebar items={navItems} />} > {children} </Layout>
Custom Hooks for Logic Separation
Never clutter UI components with complex logic. Extract it.
// hooks/useAsync.js export const useAsync = (asyncFunction, immediate = true) => { const [status, setStatus] = useState("idle"); const [value, setValue] = useState(null); const [error, setError] = useState(null); const execute = useCallback(() => { setStatus("pending"); setValue(null); setError(null); return asyncFunction() .then((response) => { setValue(response); setStatus("success"); }) .catch((error) => { setError(error); setStatus("error"); }); }, [asyncFunction]); useEffect(() => { if (immediate) execute(); }, [execute, immediate]); return { execute, status, value, error }; };
Performance Optimization
: Cache expensive calculations.useMemo
: Stabilize function references (crucial for passing props to optimized child components).useCallback
: Prevent re-renders of pure components.React.memo
2. Tailwind CSS Mastery
Tailwind is more than utility classes; it's a design system engine.
Arbitrary Values & One-offs
Use
[] syntax for precise control when design tokens don't fit, but overuse indicates a weak design system.
<div class="top-[17px] w-[calc(100%-20px)] bg-[#1a1a1a]"></div>
Advanced Selectors
- Group Hover: Style child based on parent state.
<div class="group card"> <p class="text-gray-500 group-hover:text-white transition">Content</p> </div> - Peer Modifiers: Style sibling based on previous sibling state (great for form validation).
<input class="peer invalid:border-red-500" required /> <p class="invisible peer-invalid:visible text-red-500">Error</p> - Direct Children:
(applies padding to all direct children).*:p-4
Tailwind Variables (v4+)
Access CSS variables directly in classes if configured, or use arbitrary values to set them.
<div class="--bg-opacity:0.5 bg-black/[var(--bg-opacity)]"></div>
3. Framer Motion Excellence
Animations should be physics-based, not linear.
The layout
Prop
layoutMagically animate layout changes (reordering lists, expanding cards).
<motion.div layout transition={{ type: "spring", stiffness: 300, damping: 30 }}> {/* Content that changes size/position */} </motion.div>
Variants for Orchestration
Coordinate animations between parent and children.
const listVariants = { hidden: { opacity: 0 }, show: { opacity: 1, transition: { staggerChildren: 0.1, delayChildren: 0.3, }, }, }; const itemVariants = { hidden: { opacity: 0, y: 20 }, show: { opacity: 1, y: 0 }, }; // Usage <motion.ul variants={listVariants} initial="hidden" animate="show"> <motion.li variants={itemVariants}>Item 1</motion.li> <motion.li variants={itemVariants}>Item 2</motion.li> </motion.ul>;
Gestures
Add tactile feedback easily.
<motion.button whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} transition={{ type: "spring", stiffness: 400, damping: 17 }} > Click Me </motion.button>
Professional Workflow
1. Component scaffolding
Always create components with a future-proof interface.
- use
orts
with JSDocjs - define
prop for overrides usingclassName
andclsxtailwind-merge
import { cn } from "@/lib/utils"; // standard shadcn/ui utility export function Button({ className, variant, ...props }) { return ( <button className={cn( "rounded px-4 py-2 font-medium transition active:scale-95", variant === "primary" && "bg-blue-600 text-white hover:bg-blue-700", variant === "ghost" && "bg-transparent hover:bg-slate-100", className, )} {...props} /> ); }
2. Responsive Strategy
- Mobile First: default classes are mobile.
is "tablet and up".md: - Container Queries: Use
for component-level responsiveness.@tailwindcss/container-queries
3. Accessibility (A11y)
- Radix UI / Headless UI: Use headless components for complex interactive elements (Dialogs, Dropdowns) to ensure full keyboard navigation and screen reader support.
- Focus States: Never remove
without adding a custom focus style (outline-none
).focus-visible:ring-2
Troubleshooting Common Issues
"My animation jumps/glitches"
- Ensure
animations have stable keys.layout - Check if you are animating
withoutheight: auto
prop.layout
"Tailwind classes aren't applying"
- Check
tailwind.config.js
array covers the file path.content - Are you dynamically constructing class names?
will NOT work. Full class names must exist in source code.bg-${color}-500
"Re-renders are killing performance"
- Use React DevTools Profiler.
- Check for objects/arrays defined inside component body being passed as props (breaking strict equality checks). Wrap them in
or move outside component.useMemo