How to use the clip-path generator
- Pick a shape: triangle, trapezoid, rhombus, pentagon, hexagon, octagon, star, cross, arrows, chevron, message bubble and more.
- Drag the round handles to move each point. On a focused handle, the arrow keys move it by 1% (hold Shift for 10%).
- Toggle Show the unclipped area to see which parts of the element are hidden.
- Copy the
clip-pathdeclaration and add it to any element: an image, a card, a section background.
clip-path shape functions
polygon()takes a list of points as x and y percentages of the element's box. Any straight-edged shape is possible.circle(50% at 50% 50%)andellipse()make round masks.inset(10% round 16px)trims the edges and can round the corners.
Because the points are percentages, the shape scales with the element. Everything outside the path is invisible and does not receive clicks.
Tips
- Slanted sections:
polygon(0 0, 100% 0, 100% 85%, 0 100%)gives a hero or section an angled bottom edge. - Animate shapes: transitions work between two polygons with the same number of points.
- Clipped elements lose their outer
box-shadow. Usefilter: drop-shadow()on a parent element instead. - Make sure important content, such as text or a focus ring, is not clipped away.
For simple arrows and tooltip pointers, try the CSS triangle generator; for rounded organic shapes, use the border radius generator.