Image trail
Moving the pointer over an area leaves a trail of photos that pop in where it is, lean with the direction of travel and fall away a moment later. The trail sits behind your content and never takes clicks.
When to use
- Portfolio, studio and editorial heroes with a strong photo set.
- Event and campaign pages where the pictures are the message.
When not to use
- Product UI; it is decoration for marketing surfaces.
- Photos people need to see properly; each one is gone in under a second.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/image-trail
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
ImageTrail
3 props
Also accepts the native props of its root element and a ref.
PropTypeDefaultDescription
images *string[]—Photos shown in turn along the pointer's path. They are decoration, so they carry no alt text.
spacingnumber90Pixels the pointer travels before the next photo appears.
lingernumber700How long each photo stays before it falls away, in ms.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-hidden in step with state.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/image-trail.mdThe index of every part is at /llms.txt.
More in Media
Hover image linksA list of links that shows each one's picture beside the pointer. The preview trails on a soft spring, leans with its speed and crossfades between pictures as you move down the list.Photo pilePhotos dropped in a loose pile that spreads into a grid. Each photo travels from the pile to its cell, straightening as it goes, and gathers back the same way. The pile shows the top three and a count.Cursor labelA small pill follows the pointer over a labelled area and says what a click does there: Drag, Play, Open. On touch it becomes a label in the corner.