Micro-interactions

Aperture

A camera iris. Blades pivot on a ring of pins and one shared angle drives the whole mechanism — wide open at 64% of the housing, past the centre and light-tight at zero, cutting the scalloped polygon a real iris makes on the way through.

Install

bun add motion clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/aperture/aperture.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
bladeCountnumber8How many leaves in the mechanism. Low counts give the hard hexagonal bokeh of a cheap lens; past nine the opening is indistinguishable from a circle, which is exactly what expensive glass is sold on.
opennessnumber0.62Where the blades rest, 0 shut to 1 wide. At 0 they cross past the centre rather than merely meeting it — an iris that only just touches leaks light.
durationnumber900Time for one full open or close.
detentnumber0.35Overshoot as the mechanism seats. 0 arrives dead, which reads as software; a little bounce reads as a part with mass hitting its stop.
bladeCurvaturenumber1Curvature of each blade's inner edge. The mechanism is derived from the opening range, so this bends the leaf without touching the travel: flatter blades cut a rounder, more regular polygon, tighter ones pull the scallop corners out into a star.
edgeHighlightnumber0.6Strength of the seam along each leaf's inner edge, and of the bezel. Each seam is cut by the leaf that lies over it — named rather than left to the drawing order, because a leaf stack is a ring and painter's order is a line. That is what puts exactly one line at every corner of the opening, wide open and shut alike.
housingInsetnumber6Width of the machined ring inside the rim. It is drawn over the blades, so the housing reads as the part they are seated in rather than one more leaf.
autoOpenbooleantrueOpen and shut on a loop. Turning it off hands the mechanism to the openness slider.
bladeColorstring (hex)"#26232c"Body of the blades, the housing, and the barrel floor behind them. Its own material rather than a themed surface — a light theme must not put a white ring around a lens.
edgeColorstring (hex)"#000000"Amethyst on the blade seams and the bezel.

What It Demonstrates

Reveal
Content is uncovered gradually, often by animating a clip-path or mask.
Rotate
Spin an element around a point.
Clip-path
Clipping an element to a shape, used for reveals, masks, and before/after sliders.
Orchestration
Deliberately timing multiple animations so they feel like one coordinated motion.
Bounce
A spring that overshoots and settles, adding playfulness.
Ease-in-out
Slow, fast, slow. Good for elements already on screen moving from A to B.

Related Components

Appears In