Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/container-overflow-hidden.md
1---2title: Overflow Hidden on Animated Container3impact: MEDIUM4tags: container, overflow, clip5---67## Overflow Hidden on Animated Container89Set overflow: hidden on the animated outer container to clip content during size transitions.1011**Incorrect (content overflows during animation):**1213```tsx14<motion.div animate={{ height: bounds.height }}>15<div ref={ref}>{children}</div>16</motion.div>17```1819**Correct (clipped during transition):**2021```tsx22<motion.div animate={{ height: bounds.height }} style={{ overflow: "hidden" }}>23<div ref={ref}>{children}</div>24</motion.div>25```26