More components in Pro
Galleries, cards and interactive pieces for pages that need more than the basics.
items | Array<{ src: string; alt?: string; title?: string; subtitle?: string }> | 12 sample photos | Images shown in the row. Each keeps its natural aspect ratio unless fit is set. The alt text is announced to screen readers, the title and optional subtitle are shown above the row. |
preset | 'liquid' | 'ribbon' | 'vortex' | 'arch' | 'liquid' | A starting shape for the invisible glass. Every lens prop below overrides the preset value when you pass it. |
| 'rise' | 'bloom' | 'spin' | 'deal' | 'none' | 'rise' | Entrance once the images load. Rise lifts the cards in from below, bloom fades them in while the bend forms, spin lands a fast flick, deal spreads the cards from the middle. Any input skips it. | |
fit | 'natural' | 'portrait' | 'square' | 'landscape' | 'natural' | Card shape. Natural keeps each image uncropped, the others crop every card to the same shape. |
cardHeight | 0.5 | Card height as a fraction of the container height. | |
gap | 12 | Space between cards, in px. | |
radius | Corner radius of the cards, in px. | ||
lensWidth | from preset | Width of the invisible glass as a fraction of the container width. | |
lensHeight | from preset | Height of the invisible glass as a fraction of the container width, so the bend keeps its shape at any size. | |
tilt | from preset | Rotation of the glass in degrees. It decides where its edge crosses the row. | |
roundness | from preset | Shape of the glass, from a rounded rectangle at 0 to a perfect ellipse at 1. | |
bend | from preset | How far the row flexes where it passes the edge of the glass. The glass itself is never drawn and the images always stay connected. | |
reach | from preset | Width of the curved edge of the glass. Small values give a tight kink, large values a long smooth bend. | |
curl | 'twist' | 'rise' | 'fall' | from preset | Which way the ends of the row flex. Twist sends the left end down and the right end up, rise lifts both, fall drops both. |
dispersion | from preset | Rainbow splitting of light, only where the edge of the glass bends the images. | |
liquid | from preset | How much the glass stretches and wobbles like a liquid when the row moves. Off in every preset. | |
followCursor | from preset | Let the lens drift after the cursor like a loupe, and return to the center when it leaves. | |
squeeze | 0.2 | How much the cards shrink while the row moves fast. 0 keeps them at full size. | |
focusOnClick | Clicking a card centers it and opens it: the others part, the bend melts away and the card grows. Click, drag, scroll or Escape closes it. | ||
autoplay | Advance one card at a time. Pauses on hover, focus and interaction, and when reduced motion is on. | ||
interval | 4 | Seconds between autoplay steps. | |
captions | Show the title of the centered card above the row and a counter below it. | ||
captureWheel | Let a vertical mouse wheel scroll the carousel while hovering. Horizontal wheels and trackpads always scroll it. | ||
onChange | (index: number, item) => void | Called whenever a different card reaches the center. | |
onSelect | (index: number, item) => void | Called when the centered card is clicked or Enter is pressed. Clicking a side card centers it first. | |
| Extra classes on the container. | |||
| Inline styles on the container. |
itemsArray<{ src: string; alt?: string; title?: string; subtitle?: string }>Images shown in the row. Each keeps its natural aspect ratio unless fit is set. The alt text is announced to screen readers, the title and optional subtitle are shown above the row.
12 sample photospreset'liquid' | 'ribbon' | 'vortex' | 'arch'A starting shape for the invisible glass. Every lens prop below overrides the preset value when you pass it.
'liquid'intro'rise' | 'bloom' | 'spin' | 'deal' | 'none'Entrance once the images load. Rise lifts the cards in from below, bloom fades them in while the bend forms, spin lands a fast flick, deal spreads the cards from the middle. Any input skips it.
'rise'fit'natural' | 'portrait' | 'square' | 'landscape'Card shape. Natural keeps each image uncropped, the others crop every card to the same shape.
'natural'cardHeightnumberCard height as a fraction of the container height.
0.5gapnumberSpace between cards, in px.
12radiusnumberCorner radius of the cards, in px.
lensWidthnumberWidth of the invisible glass as a fraction of the container width.
from presetlensHeightnumberHeight of the invisible glass as a fraction of the container width, so the bend keeps its shape at any size.
from presettiltnumberRotation of the glass in degrees. It decides where its edge crosses the row.
from presetroundnessnumberShape of the glass, from a rounded rectangle at 0 to a perfect ellipse at 1.
from presetbendnumberHow far the row flexes where it passes the edge of the glass. The glass itself is never drawn and the images always stay connected.
from presetreachnumberWidth of the curved edge of the glass. Small values give a tight kink, large values a long smooth bend.
from presetcurl'twist' | 'rise' | 'fall'Which way the ends of the row flex. Twist sends the left end down and the right end up, rise lifts both, fall drops both.
from presetdispersionnumberRainbow splitting of light, only where the edge of the glass bends the images.
from presetliquidnumberHow much the glass stretches and wobbles like a liquid when the row moves. Off in every preset.
from presetfollowCursorbooleanLet the lens drift after the cursor like a loupe, and return to the center when it leaves.
from presetsqueezenumberHow much the cards shrink while the row moves fast. 0 keeps them at full size.
0.2focusOnClickbooleanClicking a card centers it and opens it: the others part, the bend melts away and the card grows. Click, drag, scroll or Escape closes it.
autoplaybooleanAdvance one card at a time. Pauses on hover, focus and interaction, and when reduced motion is on.
intervalnumberSeconds between autoplay steps.
4captionsbooleanShow the title of the centered card above the row and a counter below it.
captureWheelbooleanLet a vertical mouse wheel scroll the carousel while hovering. Horizontal wheels and trackpads always scroll it.
onChange(index: number, item) => voidCalled whenever a different card reaches the center.
onSelect(index: number, item) => voidCalled when the centered card is clicked or Enter is pressed. Clicking a side card centers it first.
Extra classes on the container.
Inline styles on the container.
Dependencies
1 required package
npm install ogl


