Photo cards that flow between rings, spirals and globes
| Name | Type | Default | Description |
|---|---|---|---|
items | { src: string; alt: string; title?: string; subtitle?: string }[] | studio portrait collection | Images to place on the cards. They repeat when there are more cards than items. Images must allow cross-origin loading. Title and subtitle are shown as a caption when a card is opened. |
count | number | 56 | Number of cards, up to 160. |
formations | ("orbits" | "spiral" | "sphere" | "field")[] | ["orbits", "spiral", "sphere", "field"] | Formations to move through, in order: counter-rotating rings, a golden-angle spiral, a turning globe and a drifting field. Pass one to stay on it. |
interval | number | 6 | Seconds spent in each formation before moving to the next. |
autoplay | boolean | true | Move through the formations on a timer. The arrow keys and the ref still work when it is off. |
transition | "gather" | "swirl" | "direct" | "gather" | How cards travel between formations: gathering into a cluster and bursting out, curving around the centre, or flying straight. |
rings | number | 3 | Number of rings in the orbits formation. |
cardSize | number | 0 | Base card size in pixels. 0 sizes the cards from the container. |
clearance | number | 0.36 | Share of the container kept empty in the middle of the orbits, spiral and field formations, for a headline or call to action. |
spin | number | 1 | Rotation and drift speed. Negative values reverse it. |
shape | "auto" | "square" | "rounded" | "circle" | "auto" | Card shape. Auto uses rounded cards in the orbits and spiral and circles in the globe and field, morphing between them. |
radius | number | 0.24 | Corner rounding of rounded cards, from 0 to 1. |
depth | number | 0 | How far the whole group tilts toward the pointer. 0 keeps it flat. |
hoverScale | number | 1.2 | Scale of the card under the pointer. It keeps its angle and holds still so it can be clicked. |
shadow | number | 0.6 | Opacity of the soft shadow beneath each card. |
accentColor | string | "#B19EEF" | Colour of the thin ring around the card under the pointer. |
backgroundColor | string | "transparent" | Background of the component. Transparent shows the page behind. |
openOnClick | boolean | true | Clicking a card enlarges it in the centre. Click again or press Escape to put it back. |
captions | boolean | true | Show the title and subtitle of an opened card. |
interactive | boolean | true | Enable the pointer lens, tilt, hover and clicking. |
draggable | boolean | true | Dragging spins the rings, spiral and globe or pans the field, with inertia. |
pauseOnHover | boolean | true | Stop the rotation and hold the current formation while the pointer is on a card. |
seed | number | 0 | Changes the field layout and the small tilts of the cards. |
paused | boolean | false | Stops rotation and the formation timer. Reduced-motion users always get this. |
dpr | number | 2 | Maximum device pixel ratio for the canvas. |
ariaLabel | string | "Photo constellation…" | Accessible description of the gallery and how to use it. |
onFormationChange | (formation, index) => void | — | Called when the group starts moving to a new formation. |
onOpen | (item, index) => void | — | Called when a card is opened, with null and -1 when it is put back. |
ref | { next, previous, setFormation, close } | — | Imperative controls for stepping through formations and closing an opened card. |
children | ReactNode | — | Content centred over the group, such as a headline. It fades out while a card 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 }[]Images to place on the cards. They repeat when there are more cards than items. Images must allow cross-origin loading. Title and subtitle are shown as a caption when a card is opened.
studio portrait collectioncountnumberNumber of cards, up to 160.
56formations("orbits" | "spiral" | "sphere" | "field")[]Formations to move through, in order: counter-rotating rings, a golden-angle spiral, a turning globe and a drifting field. Pass one to stay on it.
["orbits", "spiral", "sphere", "field"]intervalnumberSeconds spent in each formation before moving to the next.
6autoplaybooleanMove through the formations on a timer. The arrow keys and the ref still work when it is off.
truetransition"gather" | "swirl" | "direct"How cards travel between formations: gathering into a cluster and bursting out, curving around the centre, or flying straight.
"gather"ringsnumberNumber of rings in the orbits formation.
3cardSizenumberBase card size in pixels. 0 sizes the cards from the container.
0clearancenumberShare of the container kept empty in the middle of the orbits, spiral and field formations, for a headline or call to action.
0.36spinnumberRotation and drift speed. Negative values reverse it.
1shape"auto" | "square" | "rounded" | "circle"Card shape. Auto uses rounded cards in the orbits and spiral and circles in the globe and field, morphing between them.
"auto"radiusnumberCorner rounding of rounded cards, from 0 to 1.
0.24depthnumberHow far the whole group tilts toward the pointer. 0 keeps it flat.
0hoverScalenumberScale of the card under the pointer. It keeps its angle and holds still so it can be clicked.
1.2shadownumberOpacity of the soft shadow beneath each card.
0.6accentColorstringColour of the thin ring around the card under the pointer.
"#B19EEF"backgroundColorstringBackground of the component. Transparent shows the page behind.
"transparent"openOnClickbooleanClicking a card enlarges it in the centre. Click again or press Escape to put it back.
truecaptionsbooleanShow the title and subtitle of an opened card.
trueinteractivebooleanEnable the pointer lens, tilt, hover and clicking.
truedraggablebooleanDragging spins the rings, spiral and globe or pans the field, with inertia.
truepauseOnHoverbooleanStop the rotation and hold the current formation while the pointer is on a card.
trueseednumberChanges the field layout and the small tilts of the cards.
0pausedbooleanStops rotation and the formation timer. Reduced-motion users always get this.
falsedprnumberMaximum device pixel ratio for the canvas.
2ariaLabelstringAccessible description of the gallery and how to use it.
"Photo constellation…"onFormationChange(formation, index) => voidCalled when the group starts moving to a new formation.
—onOpen(item, index) => voidCalled when a card is opened, with null and -1 when it is put back.
—ref{ next, previous, setFormation, close }Imperative controls for stepping through formations and closing an opened card.
—childrenReactNodeContent centred over the group, such as a headline. It fades out while a card is open.
—classNamestringClasses for the root element. It fills its parent, with a 420px minimum height.
—styleCSSPropertiesInline styles for the root element.
—