---
title: "Animation of layout properties (width/height/top/left/margin/padding) (lint/animate-layout-prop)"
description: "lint/animate-layout-prop: Animating layout properties forces layout + paint on every frame on the main thread, so the animation drops frames under load and…"
canonical: https://void-design.vercel.app/rules/lint/animate-layout-prop
lastModified: 2026-09-16
---

# Animation of layout properties (width/height/top/left/margin/padding)

`lint/animate-layout-prop` · severity **warn** · category Lint · detected by `void lint` and `void audit`

## Why it matters

Animating layout properties forces layout + paint on every frame on the main thread, so the animation drops frames under load and can shift surrounding content.

## How to fix it

Animate `transform` and `opacity` instead (`scale`, `translate`, `clip-path`), use `grid-template-rows: 0fr → 1fr` for accordions, or motion's `layout` prop for size changes.

## Example

```css
@keyframes enter { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
```

## References

- https://web.dev/articles/animations-guide
- https://motion.dev/docs/react-layout-animations

## More lint rules

`void lint` reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.

- `useeffect-fetch` Page fetches its data in `useEffect` — [lint/useeffect-fetch](https://void-design.vercel.app/rules/lint/useeffect-fetch)
- `div-button` Clickable `<div>`/`<span>` without button semantics — [lint/div-button](https://void-design.vercel.app/rules/lint/div-button)
- `dangerously-set-jsonld-unescaped` JSON-LD injected with `JSON.stringify` without escaping `<` — [lint/dangerously-set-jsonld-unescaped](https://void-design.vercel.app/rules/lint/dangerously-set-jsonld-unescaped)
- `transition-all` `transition: all` / `transition-all` — [lint/transition-all](https://void-design.vercel.app/rules/lint/transition-all)
- `outline-none-no-replacement` Focus outline removed without a visible replacement — [lint/outline-none-no-replacement](https://void-design.vercel.app/rules/lint/outline-none-no-replacement)
- `scale-zero-entry` Element enters from `scale(0)` — [lint/scale-zero-entry](https://void-design.vercel.app/rules/lint/scale-zero-entry)
- `scroll-timeline-no-fallback` Base rule hides an element; only an `@supports (animation-timeline: …)` block undoes it — [lint/scroll-timeline-no-fallback](https://void-design.vercel.app/rules/lint/scroll-timeline-no-fallback)
- `ease-in-enter` `ease-in` used for an entrance or hover — [lint/ease-in-enter](https://void-design.vercel.app/rules/lint/ease-in-enter)

Detected by `void lint` and `void audit`. Explain it in a terminal: `void rules lint/animate-layout-prop`
