Skip to content
caliper ui pro docs

Zoom lens

A magnifier that follows the pointer, a finger or the arrow keys over an image to show detail.

Pro

When to use

  • Product photos, scans, receipts and signatures.
  • Images whose detail matters but the layout is small.

When not to use

  • Photos people browse; open a full-screen viewer instead.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/zoom-lens

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

ZoomLens

7 props
PropTypeDefaultDescription
src *string—
alt *string—
width *number—
height *number—
zoomnumber2.5How many times larger the lens shows.
lensSizenumber140
classNamestring—

Keyboard

Escape
Closes or cancels, then returns focus to where it came from.
→
Moves to the next item or value.
←
Moves to the previous item or value.
↓
Moves to the next item or value.
↑
Moves to the previous item or value.

Accessibility

It exposes img semantics, with aria-label, aria-describedby and aria-hidden kept in step with state.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/zoom-lens.md

The index of every part is at /llms.txt.

More in Media