Back to components
ElementMiscFree

Image Shape Mask React component

Masks an image into a shape (circle, squircle, arch, hexagon, flower, blob or diamond) that grows out from the centre as it scrolls into view and morphs smoothly into another shape on hover while the photo slowly zooms.

About the Image Shape Mask component

Image Shape Mask clips a photo into a shape: circle, squircle, arch, hexagon, flower, blob or diamond. On hover it morphs smoothly into a second shape and the photo zooms in slightly, and the first time it scrolls into view the shape grows out from the center. Every shape is built from the same 72 points, which is what lets any shape morph into any other.

src and alt set the image, shape the resting shape (blob by default) and hoverShape the one it morphs into (circle by default). aspectRatio sets the box proportions, such as "1 / 1" or "4 / 5", and the image covers the box inside the mask. animateIn turns the grow-in on or off and zoom the hover zoom. Under reduced motion the shape is shown straight away and the morph and zoom are skipped.

When to use it

Use Image Shape Mask to give photos personality on team pages, testimonials, portfolios and hero sections, where a plain rectangle feels generic.

Stick to one or two shapes per page so the masks read as a style rather than noise.

Installation

Add the Image Shape Mask component to your project with the shadcn CLI. It lands in components/image-shape-mask.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/image-shape-mask

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Related components

Typography Prose
Free
Animated Underline Link
Free
Toggle Price Counter
Free
Ripple Click Effect
Free
Toast Stack
Free
Notification Center
Free