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-20
level, not random values per section). [web:210][web:213]
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, 27px jaisi values avoid karo.
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.
- Text blocks ko readable width tak limit karo (around 60–80 chars
per line for body text). [web:216][web:222]
Typography & color hierarchy
Type scale
- Fixed typographic scale use karo:
- Heading levels: e.g.
h1, h2, h3 with decreasing sizes.
- Body text: 1–2 sizes (base + small).
- Har level ke liye consistent:
font-size, line-height, font-weight. [web:216][web:219][web:222]
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).
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.
- Hover state:
- Slight elevation ya scale via
transform + box-shadow change
(avoid layout reflow). [web:204][web:205][web:211]
Lists & rows
- Repeated items (tasks, features) me:
- Consistent gap (
gap-4, gap-6).
- Consistent alignment of titles, metadata, actions.
Buttons & CTAs
- Primary button style:
- High-contrast background + white/near-white text.
- Clear hover/focus states.
- Secondary / ghost buttons consistent alternate style use karein.
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-shadow in heavy/continuous animations (ye layout / paint
thrash kar sakte hain). [web:204][web:205][web:211][web:217]
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-in for exit animations.
- For micro interactions, consider standard easing curves library
(Framer Motion defaults ya custom bezier). [web:206][web:209]
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.
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: transform ya 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:
useReducedMotion hook se motion intensity kam
karo ya turn off karo. [web:209][web:221]
- Large page transitions / auto-scrolling effects reduced motion
users ke liye skip karo.
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
variants objects define karo (e.g. fadeInUp, scaleOnHover)
jo multiple components reuse karein.
- Layout transitions sirf jahan actual layout change ho; avoid
overusing
layout prop everywhere.
Page transitions
- App Router layout me:
PageTransition wrapper component use karo jo:
- Initial:
opacity: 0, y: 8
- Animate:
opacity: 1, y: 0
- Exit:
opacity: 0, y: -4
- Duration ~ 0.2–0.3s, easing
easeOut. [web:209][web:212][web:218][web:221]
Scroll-reveal
- Intersection Observer ya
whileInView (Framer) ka use karo:
- Trigger once per section, threshold ~ 0.15–0.3.
initial off-screen + low opacity, whileInView on-screen. [web:209][web:212]
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.
1---2name: nextjs-ui-ux-and-animations3description: Opinionated UI/UX and high-performance animation system for Next.js App Router projects: layout, spacing, typography, and smooth, GPU-friendly motion patterns.4---5
6# Next.js UI/UX and Animations Skill
7
8## When to use this Skill
9
10Is Skill ko tab use karo jab:
11
12- Next.js 16+ App Router frontend design kar rahe ho (landing pages,
13 dashboards, marketing sites, SaaS UI, etc.).
14- Tum chahte ho ke Claude **hamesha ek hi visual language** follow kare:
15 spacing, typography, color, layout.
16- Tumko **smooth but fast** animations chahiye jo FPS kill na karein:
17 CSS/Framer Motion patterns jo sirf GPU-friendly properties animate
18 karein. [web:204][web:205][web:211][web:214]
19
20Ye Skill generic hai, kisi ek repo tak limited nahi, lekin Next.js App
21Router + React ecosystem assume karta hai.
22
23---
24
25## Tech + design assumptions
26
27- Frontend: Next.js 16+ App Router.
28- Styling: Tailwind CSS ya CSS Modules/vanilla-extract style utility
29 approach (Skill framework-agnostic but utility-first friendly).
30- Animation libs:
31 - Native CSS transitions/animations (preferred for simple hovers,
32 reveals). [web:204][web:205][web:208]
33 - Framer Motion for complex/conditional motion (page transitions,
34 layout animations). [web:209][web:212][web:218][web:221]
35- Design system:
36 - 4- or 8-point spacing system (spacing values multiples of 4). [web:210][web:213]
37 - Limited, consistent typographic scale (3–6 sizes, clear hierarchy). [web:216][web:219][web:222]
38
39Koi specific color palette enforce nahi hota; ye Skill sirf **structure
40aur motion** ke rules define karta hai.
41
42---
43
44## Layout & spacing principles
45
46- **Sectioning the page**
47
48 - Har major screen ko clear sections me todho:
49 - Hero / header section.
50 - Content sections (features, stats, lists).
51 - Call-to-action (CTA) bands.
52 - Footer.
53 - Har section ka vertical spacing consistent ho (e.g. `py-16`, `py-20`
54 level, not random values per section). [web:210][web:213]
55
56- **Spacing system**
57
58 - Spacing 4- ya 8-point grid follow kare:
59 - Allowed values: 4, 8, 12, 16, 20, 24, 32, 40, 48, 64... px equivalents. [web:210][web:213]
60 - Components ke andar padding/margin inhi values ke multiples me ho,
61 random `13px`, `27px` jaisi values avoid karo.
62
63- **Grids & alignment**
64
65 - Desktop par 12-column mental grid follow karo (even agar Tailwind
66 se implement ho):
67 - Content max-width constrained (e.g. `max-w-5xl` / `max-w-6xl`) and
68 horizontally centered.
69 - Text blocks ko readable width tak limit karo (around 60–80 chars
70 per line for body text). [web:216][web:222]
71
72---
73
74## Typography & color hierarchy
75
76- **Type scale**
77
78 - Fixed typographic scale use karo:
79 - Heading levels: e.g. `h1`, `h2`, `h3` with decreasing sizes.
80 - Body text: 1–2 sizes (base + small).
81 - Har level ke liye consistent:
82 - `font-size`, `line-height`, `font-weight`. [web:216][web:219][web:222]
83
84- **Hierarchy**
85
86 - Har section me:
87 - 1 primary heading (visual focal point).
88 - Optional subtitle/eyebrow text for context.
89 - Body copy for detail.
90 - Over-decoration avoid karo (too many fonts, colors, sizes).
91
92- **Color & contrast**
93
94 - Primary + accent color limited rakho (1–2 main accent colors).
95 - Text/background contrast sufficient ho, WCAG-friendly (dark text on
96 light bg ya vice versa). [web:216][web:219]
97
98---
99
100## Component patterns (cards, lists, CTAs)
101
102- **Cards**
103
104 - Card pattern:
105 - Padding follows spacing grid (e.g. `p-4`, `p-6`).
106 - Border-radius consistent across app.
107 - Shadow ya border ek hi scale ka use karo across cards.
108 - Hover state:
109 - Slight elevation ya scale via `transform` + `box-shadow` change
110 (avoid layout reflow). [web:204][web:205][web:211]
111
112- **Lists & rows**
113
114 - Repeated items (tasks, features) me:
115 - Consistent gap (`gap-4`, `gap-6`).
116 - Consistent alignment of titles, metadata, actions.
117
118- **Buttons & CTAs**
119
120 - Primary button style:
121 - High-contrast background + white/near-white text.
122 - Clear hover/focus states.
123 - Secondary / ghost buttons consistent alternate style use karein.
124
125Claude ko new UI banate waqt ye base patterns ko reuse karna chahiye,
126na ke har page pe completely naya button/card style invent karna.
127
128---
129
130## Motion design system — core rules
131
132Aim: **smooth, 60fps‑ish** animations jo CPU/GPU pe light hon. [web:204][web:205][web:211][web:214]
133
134- **What to animate**
135
136 - Animate **only GPU-friendly properties** by default:
137 - `transform` (translate, scale, rotate).
138 - `opacity`. [web:204][web:205][web:211][web:223]
139 - Avoid animating:
140 - `top`, `left`, `width`, `height`, `margin`, `padding`,
141 `box-shadow` in heavy/continuous animations (ye layout / paint
142 thrash kar sakte hain). [web:204][web:205][web:211][web:217]
143
144- **Duration & easing**
145
146 - Use limited duration tokens:
147 - `fast` ~ 120–180ms (small hovers/feedback).
148 - `normal` ~ 200–260ms (transitions, modal open).
149 - `slow` ~ 320–400ms (page transitions, major UI change). [web:206][web:208]
150 - Easing:
151 - Default: `ease-out` / cubic functions for entry.
152 - Use `ease-in` for exit animations.
153 - For micro interactions, consider standard easing curves library
154 (Framer Motion defaults ya custom bezier). [web:206][web:209]
155
156- **Levels of motion**
157
158 - Micro interactions:
159 - Button hover: slight scale/translate, color shift.
160 - Icon hover: small rotate/bounce, opacity change.
161 - Content reveal:
162 - Section fade/slide-in on scroll (threshold-based, once per view).
163 - Page transitions:
164 - Route change par fade/slide of whole page or key sections.
165
166---
167
168## Performance & accessibility guardrails
169
170- **Performance**
171
172 - Prefer CSS transitions for simple one-off animations; JavaScript
173 driven / Framer Motion sirf jab logic/control chahiye. [web:204][web:205][web:211]
174 - Long-running or scroll‑linked animations minimal rakho; avoid heavy
175 parallax har section me. [web:205][web:211][web:214]
176 - Use `will-change: transform` ya Framer Motion ki internal
177 optimizations only jahan zaroorat ho (excessive use se bhi perf
178 down ho sakta hai). [web:204][web:211]
179
180- **Reduced motion**
181
182 - Respect user preferences:
183 - CSS: `@media (prefers-reduced-motion: reduce)` ke andar animations
184 ko disable/simplify karo. [web:205][web:214]
185 - Framer Motion: `useReducedMotion` hook se motion intensity kam
186 karo ya turn off karo. [web:209][web:221]
187 - Large page transitions / auto-scrolling effects reduced motion
188 users ke liye skip karo.
189
190- **Focus & usability**
191
192 - Animations kabhi focus/keyboard navigation ko break na karein
193 (focus rings visible, tabbable elements stable).
194 - Loading states:
195 - Use skeletons / subtle shimmer animations instead of janky
196 layout shifts.
197
198---
199
200## Framer Motion patterns (Next.js)
201
202Jab Framer Motion use ho:
203
204- **Variants & layout**
205
206 - Shared `variants` objects define karo (e.g. `fadeInUp`, `scaleOnHover`)
207 jo multiple components reuse karein.
208 - Layout transitions sirf jahan actual layout change ho; avoid
209 overusing `layout` prop everywhere.
210
211- **Page transitions**
212
213 - App Router layout me:
214 - `PageTransition` wrapper component use karo jo:
215 - Initial: `opacity: 0, y: 8`
216 - Animate: `opacity: 1, y: 0`
217 - Exit: `opacity: 0, y: -4`
218 - Duration ~ 0.2–0.3s, easing `easeOut`. [web:209][web:212][web:218][web:221]
219
220- **Scroll-reveal**
221
222 - Intersection Observer ya `whileInView` (Framer) ka use karo:
223 - Trigger once per section, threshold ~ 0.15–0.3.
224 - `initial` off-screen + low opacity, `whileInView` on-screen. [web:209][web:212]
225
226Claude ko nayi animations likhte waqt yahi patterns reuse karne chahiye
227instead of har jaga naya custom Framer code likhne ke.
228
229---
230
231## Things to avoid
232
233- Over-animating: har element pe heavy motion, har hover par big scale
234 ya bounce; app cheap lagti hai aur performance girta hai. [web:205][web:211]
235- Animating layout-affecting properties (width/height/margins) in
236 continuous loops; is se reflow + repaint issues aate hain. [web:204][web:205][web:217]
237- Using multiple disjoint spacing/typography scales in the same app.
238- Scroll-jacking (custom scroll behavior jo default scroll ko override kare)
239 unless spec explicitly demand kare.
240
241---
242
243## References inside a repo
244
245Jab ye Skill use ho:
246
247- Design guidelines / tokens ideally:
248 - `frontend/styles/design-tokens.(ts|json)` – spacing, durations,
249 easing, radii, etc.
250 - `frontend/components/ui/` – base components (Button, Card, Section,
251 PageTransition, etc.) jo in rules ko enforce karein.
252- Framer Motion wrappers:
253 - `frontend/components/motion/` – reusable motion primitives based on
254 is Skill ke patterns.
255
256Agar ye files missing hon, Claude ko propose karna chahiye ke pehle
257yeh base components/tokens create karein, phir nayi screens unka reuse
258kar ke banayein — is tarah tumhara UI/UX + animations ek **signature
259style** ban jayega jo har nayi app me recognizable rehega.