DevBolt
Processed in your browser. Your data never leaves your device.

Animating CSS Clip-path Shapes

CSS clip-path is animatable, making it perfect for reveal effects, shape morphing, and interactive hover states. The key constraint: both the start and end states must use the same shape function with the same number of points.

CSS Clip-path Generator

Create CSS clip-path shapes visually — circle, ellipse, inset, or polygon with draggable points. Copy production-ready CSS.

Polygon Points (3)

Drag points on the preview or edit values below.

1%%
2%%
3%%

Shape Presets

Preview Colors

#6366f1
#1f2937

Preview

CSS Output

clip-path: polygon(50% 0%, 0% 100%, 100% 100%);

Ctrl+Enter to copy CSS

Clip-path Reference

circle(r at cx cy) — circular clip
ellipse(rx ry at cx cy) — elliptical clip
inset(t r b l round br) — rectangular clip with optional rounding
polygon(x1 y1, x2 y2, ...) — arbitrary polygon with unlimited vertices

Supported in all modern browsers. Use -webkit-clip-path for older Safari versions.

Transition basics

Add transition: clip-path 0.3s ease to smoothly animate between clip-path states on hover or class changes. For example, transitioning from circle(0% at 50% 50%) to circle(100% at 50% 50%) creates a circular reveal. The browser interpolates each numeric value independently, producing smooth animation.

Polygon morphing

To morph between polygon shapes, both states must have the same number of vertices. polygon(50% 0%, 100% 100%, 0% 100%) can smoothly transition to polygon(50% 20%, 80% 80%, 20% 80%) because both have 3 points. If you need to morph between shapes with different point counts, pad the simpler shape by duplicating vertices at the same position.

Keyframe animations

Use @keyframes for multi-step clip-path animations: define clip-path values at each percentage step. This enables effects like rotating stars, pulsing shapes, or complex reveal sequences. Performance tip: clip-path animations trigger paint but not layout, so they perform well. For best performance, apply will-change: clip-path to hint the browser to optimize the layer.

Frequently Asked Questions

Why is my clip-path animation not working?

The most common cause is mismatched shape functions or point counts. Both the start and end clip-path must use the same function (e.g., both polygon()) with the same number of coordinate pairs. Also ensure you have a transition property set — clip-path does not animate automatically.

Can I animate from circle to polygon?

Not directly — CSS cannot interpolate between different shape functions. The workaround is to use polygon() for both states, approximating the circle with many points (e.g., 36 points on a circular path). Or use two overlapping elements and cross-fade opacity while changing clip-path on each.

Is clip-path animation performant?

Clip-path changes trigger repaint but not reflow/layout, so they perform reasonably well. For heavy animations, add will-change: clip-path to promote the element to its own compositing layer. Avoid animating clip-path on many elements simultaneously — batch the animations or use requestAnimationFrame for JavaScript-driven morphing.

Related Generate Tools