shape-morph

Tailwind CSS

Use shape-morph utilities as Tailwind CSS v4 classes.

For Tailwind CSS v4, shape-morph ships a pre-built utility stylesheet. Import it alongside Tailwind and use clip-{shape} classes directly, no JavaScript is needed.

Setup

Import the stylesheet in your CSS entry point:

app.css
@import "tailwindcss";
@import "shape-morph/tailwind.css";

Usage

Apply clip-* utility classes to any element:

<img
  src="/photo.jpg"
  class="clip-heart hover:clip-circle transition-[clip-path] duration-300"
/>

All 35 Material Design 3 shapes are available as clip-* utilities (e.g. clip-circle, clip-heart, clip-diamond, clip-cookie-9-sided). Since every shape produces a polygon() with the same number of vertices, CSS transitions between any two shapes work seamlessly.

Available classes

ClassShape
clip-circleCircle
clip-squareSquare
clip-slantedSlanted
clip-archArch
clip-fanFan
clip-arrowArrow
clip-semi-circleSemiCircle
clip-ovalOval
clip-pillPill
clip-triangleTriangle
clip-diamondDiamond
clip-clam-shellClamShell
clip-pentagonPentagon
clip-gemGem
clip-sunnySunny
clip-very-sunnyVerySunny
clip-cookie-4-sidedCookie4Sided
clip-cookie-6-sidedCookie6Sided
clip-cookie-7-sidedCookie7Sided
clip-cookie-9-sidedCookie9Sided
clip-cookie-12-sidedCookie12Sided
clip-ghostishGhostish
clip-clover-4-leafClover4Leaf
clip-clover-8-leafClover8Leaf
clip-burstBurst
clip-soft-burstSoftBurst
clip-boomBoom
clip-soft-boomSoftBoom
clip-flowerFlower
clip-puffyPuffy
clip-puffy-diamondPuffyDiamond
clip-pixel-circlePixelCircle
clip-pixel-trianglePixelTriangle
clip-bunBun
clip-heartHeart

How it works

The stylesheet contains @utility directives, the preferred way for Tailwind v4 to define custom utilities in CSS. Each utility sets clip-path to a pre-computed polygon() value. Because this is pure CSS, it works with all Tailwind features like responsive prefixes, hover states, and transitions.

For programmatic access or morphing between shapes, see the CSS Clip-Path guide.

On this page