December 4, 2026
A clip-path reveal shows content by growing the visible shape around it. Set clip-path to a small or empty shape,
change it to a shape that covers the element, and add a transition. The one rule is that both states must be the same kind of
shape. Here are the three recipes used most.
1. A circle that grows from the click point
.panel {
clip-path: circle(0 at var(--x, 50%) var(--y, 50%));
transition: clip-path 0.7s cubic-bezier(0.7, 0, 0.2, 1);
}
.panel.is-open { clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); }
const panel = document.querySelector(".panel");
document.querySelector(".open").addEventListener("click", (e) => {
const r = panel.getBoundingClientRect();
panel.style.setProperty("--x", `${e.clientX - r.left}px`);
panel.style.setProperty("--y", `${e.clientY - r.top}px`);
panel.classList.toggle("is-open");
});
A radius of 150 percent is enough to cover the far corner from any starting point. Keyboard users press the button with no pointer position, in which case the click reports the centre of the button, which is a sensible origin.
2. A wipe from one side
.wipe { clip-path: inset(0 100% 0 0); transition: clip-path 0.8s ease; }
.wipe.is-in { clip-path: inset(0); }
The four values of inset() are the distances cut from the top, right, bottom and left. Cutting 100 percent from
the right hides everything, and the reveal runs left to right. Change which side carries the 100 percent to change the
direction. Add round 24px at the end for rounded corners while it opens.
3. A shape that morphs
.shape { transition: clip-path 0.6s ease; }
.shape.diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape.square { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
Both polygons have four points, so the browser can move each point to its new place. To morph between shapes with different point counts, add extra points along the edges of the simpler one until the counts match.
Why does my animation snap?
| From | To | Animates? |
|---|---|---|
none | circle(150%) | No. Start from circle(0). |
inset(...) | circle(...) | No. Different functions. |
| polygon, 4 points | polygon, 6 points | No. Match the point count. |
circle(0 at 20% 30%) | circle(150% at 20% 30%) | Yes. |
What about hidden content and focus?
A panel clipped to nothing is invisible but still in the page. Its links can still be reached with the Tab key. Add the
inert attribute while it is closed, and remove it when it opens. Under prefers-reduced-motion, swap
the growing shape for a short fade.
Which finished examples can I copy?
| Element | What it does |
|---|---|
| Circle reveal intro | A gate button opens a circle from the click point that grows to reveal the page. |
| Clip reveal menu | Text rows that open a pattern behind the word with a clip-path transition on hover. |
| Shape clip slideshow | A slideshow whose slides are revealed through a clip-path shape that morphs. |
| Expanding rounded menu | A round menu button that grows into a full rounded panel with a clip-path reveal. |
| Continuous section slides | Full-height sections that change one at a time with a clip-path wipe. |
All are free in the Enrichr Library. It lists 43 reveal elements in total.
Where to go next
- How to make a before and after image slider.
- The FLIP animation technique.
- What to do with animations when a visitor asks for reduced motion.
FAQ
Can clip-path be animated?
Yes, with a transition or keyframes, as long as both states use the same shape function. circle() to circle() and inset() to inset() animate. A polygon animates to another polygon with the same number of points.
Why does my clip-path animation jump instead of animating?
The two states do not match. You may be going from none to a shape, between two different functions, or between polygons with different point counts. Give the starting state an explicit shape of the same type.
How do I make a circle reveal from where the user clicked?
On click, store the pointer position in two CSS variables and use them as the centre: clip-path: circle(0 at var(--x) var(--y)). Then switch the radius to 150%.
Is clip-path good for performance?
It is cheaper than animating width or height because nothing is laid out again, but the clipped area is repainted. Keep durations short and avoid clipping very heavy content such as video.