
nextjs-ui-ux-and-animations
by Okashanadeem
Backend: https://giaic-q4-h2-p2-backend.vercel.app/health
SKILL.md
name: nextjs-ui-ux-and-animations description: > Opinionated UI/UX and high-performance animation system for Next.js App Router projects: layout, spacing, typography, and smooth, GPU-friendly motion patterns.
Next.js UI/UX and Animations Skill
When to use this Skill
Is Skill ko tab use karo jab:
- Next.js 16+ App Router frontend design kar rahe ho (landing pages, dashboards, marketing sites, SaaS UI, etc.).
- Tum chahte ho ke Claude hamesha ek hi visual language follow kare: spacing, typography, color, layout.
- Tumko smooth but fast animations chahiye jo FPS kill na karein: CSS/Framer Motion patterns jo sirf GPU-friendly properties animate karein. [web:204][web:205][web:211][web:214]
Ye Skill generic hai, kisi ek repo tak limited nahi, lekin Next.js App Router + React ecosystem assume karta hai.
Tech + design assumptions
- Frontend: Next.js 16+ App Router.
- Styling: Tailwind CSS ya CSS Modules/vanilla-extract style utility approach (Skill framework-agnostic but utility-first friendly).
- Animation libs:
- Native CSS transitions/animations (preferred for simple hovers, reveals). [web:204][web:205][web:208]
- Framer Motion for complex/conditional motion (page transitions, layout animations). [web:209][web:212][web:218][web:221]
- Design system:
- 4- or 8-point spacing system (spacing values multiples of 4). [web:210][web:213]
- Limited, consistent typographic scale (3–6 sizes, clear hierarchy). [web:216][web:219][web:222]
Koi specific color palette enforce nahi hota; ye Skill sirf structure aur motion ke rules define karta hai.
Layout & spacing principles
-
Sectioning the page
- Har major screen ko clear sections me todho:
- Hero / header section.
- Content sections (features, stats, lists).
- Call-to-action (CTA) bands.
- Footer.
- Har section ka vertical spacing consistent ho (e.g.
py-16,py-20level, not random values per section). [web:210][web:213]
- Har major screen ko clear sections me todho:
-
Spacing system
- Spacing 4- ya 8-point grid follow kare:
- Allowed values: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64... px equivalents. [web:210][web:213]
- Components ke andar padding/margin inhi values ke multiples me ho,
random
13px,27pxjaisi values avoid karo.
- Spacing 4- ya 8-point grid follow kare:
-
Grids & alignment
- Desktop par 12-column mental grid follow karo (even agar Tailwind
se implement ho):
- Content max-width constrained (e.g.
max-w-5xl/max-w-6xl) and horizontally centered.
- Content max-width constrained (e.g.
- Text blocks ko readable width tak limit karo (around 60–80 chars per line for body text). [web:216][web:222]
- Desktop par 12-column mental grid follow karo (even agar Tailwind
se implement ho):
Typography & color hierarchy
-
Type scale
- Fixed typographic scale use karo:
- Heading levels: e.g.
h1,h2,h3with decreasing sizes. - Body text: 1–2 sizes (base + small).
- Heading levels: e.g.
- Har level ke liye consistent:
font-size,line-height,font-weight. [web:216][web:219][web:222]
- Fixed typographic scale use karo:
-
Hierarchy
- Har section me:
- 1 primary heading (visual focal point).
- Optional subtitle/eyebrow text for context.
- Body copy for detail.
- Over-decoration avoid karo (too many fonts, colors, sizes).
- Har section me:
-
Color & contrast
- Primary + accent color limited rakho (1–2 main accent colors).
- Text/background contrast sufficient ho, WCAG-friendly (dark text on light bg ya vice versa). [web:216][web:219]
Component patterns (cards, lists, CTAs)
-
Cards
- Card pattern:
- Padding follows spacing grid (e.g.
p-4,p-6). - Border-radius consistent across app.
- Shadow ya border ek hi scale ka use karo across cards.
- Padding follows spacing grid (e.g.
- Hover state:
- Slight elevation ya scale via
transform+box-shadowchange (avoid layout reflow). [web:204][web:205][web:211]
- Slight elevation ya scale via
- Card pattern:
-
Lists & rows
- Repeated items (tasks, features) me:
- Consistent gap (
gap-4,gap-6). - Consistent alignment of titles, metadata, actions.
- Consistent gap (
- Repeated items (tasks, features) me:
-
Buttons & CTAs
- Primary button style:
- High-contrast background + white/near-white text.
- Clear hover/focus states.
- Secondary / ghost buttons consistent alternate style use karein.
- Primary button style:
Claude ko new UI banate waqt ye base patterns ko reuse karna chahiye, na ke har page pe completely naya button/card style invent karna.
Motion design system — core rules
Aim: smooth, 60fps‑ish animations jo CPU/GPU pe light hon. [web:204][web:205][web:211][web:214]
-
What to animate
- Animate only GPU-friendly properties by default:
transform(translate, scale, rotate).opacity. [web:204][web:205][web:211][web:223]
- Avoid animating:
top,left,width,height,margin,padding,box-shadowin heavy/continuous animations (ye layout / paint thrash kar sakte hain). [web:204][web:205][web:211][web:217]
- Animate only GPU-friendly properties by default:
-
Duration & easing
- Use limited duration tokens:
fast~ 120–180ms (small hovers/feedback).normal~ 200–260ms (transitions, modal open).slow~ 320–400ms (page transitions, major UI change). [web:206][web:208]
- Easing:
- Default:
ease-out/ cubic functions for entry. - Use
ease-infor exit animations. - For micro interactions, consider standard easing curves library (Framer Motion defaults ya custom bezier). [web:206][web:209]
- Default:
- Use limited duration tokens:
-
Levels of motion
- Micro interactions:
- Button hover: slight scale/translate, color shift.
- Icon hover: small rotate/bounce, opacity change.
- Content reveal:
- Section fade/slide-in on scroll (threshold-based, once per view).
- Page transitions:
- Route change par fade/slide of whole page or key sections.
- Micro interactions:
Performance & accessibility guardrails
-
Performance
- Prefer CSS transitions for simple one-off animations; JavaScript driven / Framer Motion sirf jab logic/control chahiye. [web:204][web:205][web:211]
- Long-running or scroll‑linked animations minimal rakho; avoid heavy parallax har section me. [web:205][web:211][web:214]
- Use
will-change: transformya Framer Motion ki internal optimizations only jahan zaroorat ho (excessive use se bhi perf down ho sakta hai). [web:204][web:211]
-
Reduced motion
- Respect user preferences:
- CSS:
@media (prefers-reduced-motion: reduce)ke andar animations ko disable/simplify karo. [web:205][web:214] - Framer Motion:
useReducedMotionhook se motion intensity kam karo ya turn off karo. [web:209][web:221]
- CSS:
- Large page transitions / auto-scrolling effects reduced motion users ke liye skip karo.
- Respect user preferences:
-
Focus & usability
- Animations kabhi focus/keyboard navigation ko break na karein (focus rings visible, tabbable elements stable).
- Loading states:
- Use skeletons / subtle shimmer animations instead of janky layout shifts.
Framer Motion patterns (Next.js)
Jab Framer Motion use ho:
-
Variants & layout
- Shared
variantsobjects define karo (e.g.fadeInUp,scaleOnHover) jo multiple components reuse karein. - Layout transitions sirf jahan actual layout change ho; avoid
overusing
layoutprop everywhere.
- Shared
-
Page transitions
- App Router layout me:
PageTransitionwrapper component use karo jo:- Initial:
opacity: 0, y: 8 - Animate:
opacity: 1, y: 0 - Exit:
opacity: 0, y: -4
- Initial:
- Duration ~ 0.2–0.3s, easing
easeOut. [web:209][web:212][web:218][web:221]
- App Router layout me:
-
Scroll-reveal
- Intersection Observer ya
whileInView(Framer) ka use karo:- Trigger once per section, threshold ~ 0.15–0.3.
initialoff-screen + low opacity,whileInViewon-screen. [web:209][web:212]
- Intersection Observer ya
Claude ko nayi animations likhte waqt yahi patterns reuse karne chahiye instead of har jaga naya custom Framer code likhne ke.
Things to avoid
- Over-animating: har element pe heavy motion, har hover par big scale ya bounce; app cheap lagti hai aur performance girta hai. [web:205][web:211]
- Animating layout-affecting properties (width/height/margins) in continuous loops; is se reflow + repaint issues aate hain. [web:204][web:205][web:217]
- Using multiple disjoint spacing/typography scales in the same app.
- Scroll-jacking (custom scroll behavior jo default scroll ko override kare) unless spec explicitly demand kare.
References inside a repo
Jab ye Skill use ho:
- Design guidelines / tokens ideally:
frontend/styles/design-tokens.(ts|json)– spacing, durations, easing, radii, etc.frontend/components/ui/– base components (Button, Card, Section, PageTransition, etc.) jo in rules ko enforce karein.
- Framer Motion wrappers:
frontend/components/motion/– reusable motion primitives based on is Skill ke patterns.
Agar ye files missing hon, Claude ko propose karna chahiye ke pehle yeh base components/tokens create karein, phir nayi screens unka reuse kar ke banayein — is tarah tumhara UI/UX + animations ek signature style ban jayega jo har nayi app me recognizable rehega.
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon