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-mergeThen copy 2 files into your project:
- components/registry/aperture/aperture.tsx
- lib/utils.ts
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| bladeCount | number | 8 | How 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. |
| openness | number | 0.62 | Where 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. |
| duration | number | 900 | Time for one full open or close. |
| detent | number | 0.35 | Overshoot as the mechanism seats. 0 arrives dead, which reads as software; a little bounce reads as a part with mass hitting its stop. |
| bladeCurvature | number | 1 | Curvature 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. |
| edgeHighlight | number | 0.6 | Strength 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. |
| housingInset | number | 6 | Width 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. |
| autoOpen | boolean | true | Open and shut on a loop. Turning it off hands the mechanism to the openness slider. |
| bladeColor | string (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. |
| edgeColor | string (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
Stagger Menu
A menu overlay that blooms open as a clip-path circle spring while items stagger in with blur and rotation, then collapses back to its pill.
Rift
A draggable tear between two overlaid scenes — push past an edge and it resists, then snaps back.
Pixel Transition
Reveal a second layer through a random pixelated dissolve on hover.
Animated Hamburger
A three-bar hamburger that morphs to an X, driven by a toggle prop.
Torchlight
Content hidden in darkness; the cursor is a torch that reveals only what it touches.
Dissolve
An element disintegrates into drifting shadow-motes on dismiss, and reforms on command.