An oval of photos that turns into an iris
| Name | Type | Default | Description |
|---|---|---|---|
items | { src: string; alt: string; title?: string; subtitle?: string; href?: string }[] | studio portrait collection | Images for the cards. They repeat when there are more cards than items. Images must allow cross-origin loading. Title and subtitle caption a photo when it is opened. |
count | number | 28 | Number of cards around the ring, up to 96. |
mode | "cycle" | "gallery" | "iris" | "cycle" | Cycle alternates between an oval of upright photos and the iris, where every card turns into a lit, radial blade. Gallery and iris stay in one state. |
interval | number | 6 | Seconds spent as a gallery before turning into the iris, in cycle mode. |
hold | number | 4 | Seconds held as an iris before opening back into a gallery, in cycle mode. |
morphDuration | number | 1.8 | Seconds the wave takes to travel around the ring when the state changes. |
stagger | number | 0.7 | How spread out that wave is, from the top down both sides. 0 turns every card at once. |
speed | number | 6 | Speed the cards travel around the ring, in degrees per second. Negative values reverse it. |
fin | number | 60 | Angle, in degrees, the blades turn to in the iris. Higher values give thinner, deeper blades. |
pupil | number | 0.52 | Size of the pupil as a fraction of the iris. An opened photo fills the pupil. |
cardAspect | number | 0.78 | Width divided by height of the cards in the gallery state. |
radius | number | 0.18 | Corner rounding as a fraction of the card width. |
gap | number | 0.1 | Space between cards in the gallery state, as a fraction of their spacing. |
depth | number | 1 | Strength of the perspective. |
shade | number | 0.6 | How much the blades darken as they turn away from the light. |
backgroundColor | string | "transparent" | Background of the component. Captions adapt to it. |
focusOnClick | boolean | true | Clicking a card flies its photo into the pupil while the ring closes into an iris around it. Click again or press Escape to put it back. |
captions | boolean | true | Show the title and subtitle of an opened photo. |
draggable | boolean | true | Drag around the ring to turn it, with inertia. |
wheel | boolean | true | Scroll to turn the ring, one card per notch. Set false to leave page scrolling untouched. |
pauseOnHover | boolean | true | Stop the ring and the cycle while the pointer rests on a card, which lifts so it can be clicked. |
paused | boolean | false | Stops travelling and the cycle. Reduced-motion users always get a still gallery. |
dpr | number | 2 | Maximum device pixel ratio for the canvas. |
ariaLabel | string | "Iris gallery…" | Accessible description of the gallery and how to use it. |
onFocusChange | (item, index) => void | — | Called when a photo is opened, with null and -1 when it is put back. |
onStateChange | (state: "gallery" | "iris") => void | — | Called when the ring starts turning into the other state. |
ref | { open, close, setState, rotate } | — | Imperative controls for opening a photo, switching state and turning the ring. |
children | ReactNode | — | Content centred inside the ring, such as a headline. It fades out while a photo is open. |
className | string | — | Classes for the root element. It fills its parent, with a 420px minimum height. |
style | CSSProperties | — | Inline styles for the root element. |
items{ src: string; alt: string; title?: string; subtitle?: string; href?: string }[]Images for the cards. They repeat when there are more cards than items. Images must allow cross-origin loading. Title and subtitle caption a photo when it is opened.
studio portrait collectioncountnumberNumber of cards around the ring, up to 96.
28mode"cycle" | "gallery" | "iris"Cycle alternates between an oval of upright photos and the iris, where every card turns into a lit, radial blade. Gallery and iris stay in one state.
"cycle"intervalnumberSeconds spent as a gallery before turning into the iris, in cycle mode.
6holdnumberSeconds held as an iris before opening back into a gallery, in cycle mode.
4morphDurationnumberSeconds the wave takes to travel around the ring when the state changes.
1.8staggernumberHow spread out that wave is, from the top down both sides. 0 turns every card at once.
0.7speednumberSpeed the cards travel around the ring, in degrees per second. Negative values reverse it.
6finnumberAngle, in degrees, the blades turn to in the iris. Higher values give thinner, deeper blades.
60pupilnumberSize of the pupil as a fraction of the iris. An opened photo fills the pupil.
0.52cardAspectnumberWidth divided by height of the cards in the gallery state.
0.78radiusnumberCorner rounding as a fraction of the card width.
0.18gapnumberSpace between cards in the gallery state, as a fraction of their spacing.
0.1depthnumberStrength of the perspective.
1shadenumberHow much the blades darken as they turn away from the light.
0.6backgroundColorstringBackground of the component. Captions adapt to it.
"transparent"focusOnClickbooleanClicking a card flies its photo into the pupil while the ring closes into an iris around it. Click again or press Escape to put it back.
truecaptionsbooleanShow the title and subtitle of an opened photo.
truedraggablebooleanDrag around the ring to turn it, with inertia.
truewheelbooleanScroll to turn the ring, one card per notch. Set false to leave page scrolling untouched.
truepauseOnHoverbooleanStop the ring and the cycle while the pointer rests on a card, which lifts so it can be clicked.
truepausedbooleanStops travelling and the cycle. Reduced-motion users always get a still gallery.
falsedprnumberMaximum device pixel ratio for the canvas.
2ariaLabelstringAccessible description of the gallery and how to use it.
"Iris gallery…"onFocusChange(item, index) => voidCalled when a photo is opened, with null and -1 when it is put back.
—onStateChange(state: "gallery" | "iris") => voidCalled when the ring starts turning into the other state.
—ref{ open, close, setState, rotate }Imperative controls for opening a photo, switching state and turning the ring.
—childrenReactNodeContent centred inside the ring, such as a headline. It fades out while a photo is open.
—classNamestringClasses for the root element. It fills its parent, with a 420px minimum height.
—styleCSSPropertiesInline styles for the root element.
—