Skip to content
caliper ui pro docs

Corner snap

A floating panel that sits in a corner of its container. Drag the grip and let go: the panel carries the speed of your hand, works out which corner that throw is heading for, and a spring settles it there.

Pro

Sprint planning · bottom right

Maya Chen on a video call

When to use

  • Picture-in-picture video, call windows, mini players and chat bubbles.
  • Any helper that should stay out of the way but within reach.

When not to use

  • Panels that need free placement; use `FloatingPanel`.
  • Containers that are not positioned; it needs one as its reference.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/corner-snap

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

CornerSnap

5 props

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
title *string—Names the panel; it is also the handle's name.
defaultCornerCorner"bottom-right"
cornersCorner[]allCornersThe corners it may rest in.
insetnumber16Gap kept from the container's edges, in pixels.
onCornerChange((corner: Corner) => void)—

nearestCorner

2 props
PropTypeDefault
x *number—
y *number—

Keyboard

←
Moves to the previous item or value.
→
Moves to the next item or value.
↑
Moves to the previous item or value.
↓
Moves to the next item or value.

Accessibility

It exposes status semantics, with aria-label and aria-hidden kept in step with state. Changes that matter are announced through a live region.

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/corner-snap.md

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

More in Surfaces