Clip path generator

Cut a real photo into a hexagon, circle, chevron or inset, tune the amount, then copy the clip-path as CSS or as a Tailwind arbitrary value.

A photograph cut to the current shape
clip.csscss
.shape {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
usage.tsxtsx
<div class="[clip-path:polygon(25%_0%,_75%_0%,_100%_50%,_75%_100%,_25%_100%,_0%_50%)]" />

Questions

Are the percentages relative to what?+

The element's own box, always. That is what makes a clip responsive: the same polygon holds its shape whatever size the element ends up.

Does clipping affect the layout?+

No. The element still takes its full box, and the clip only decides what is painted. Text beside it flows as though nothing was cut, which is why a clipped decoration needs its own spacing.

Can I animate one?+

Yes, between shapes with the same number of points. A polygon with four points animates to another four-point polygon; going from a circle to a polygon does not interpolate.

Related tools

The tools are free. So is most of the library.

1935 blocks and 989 pieces for shadcn/ui and Tailwind, built on the same tokens these tools write. Install one with a command and the code is yours.

No signup for the tools. MIT for free blocks, commercial licence for Pro.

Markdown version