Skip to content
caliper ui pro docs

Cart flight

A product row whose Add buttons send a copy of the product photo arcing into the cart button, which takes it with a bump while the count rolls up. The flight shows cause and effect at a distance.

Pro
  • Canvas tote$48
  • Ceramic mug set$36
  • Merino beanie$42
  • Wool throw$120

When to use

  • Shops and catalogues where the cart is not next to the product.
  • Any add-to-collection action: saving to a board, adding to a playlist.

When not to use

  • Rapid bulk adding; send many items with one summary instead.
  • Checkout pages, where the cart is already in view.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/cart-flight

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

CartFlight

4 props

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

PropTypeDefaultDescription
products *FlightProduct[]—
defaultCountnumber0Items already in the cart.
onAdd((product: FlightProduct) => void)—
onOpenCart(() => void)—

arcPoints

2 props
PropTypeDefault
x *number—
y *number—

Keyboard

  • No custom key handling; Tab and the native activation keys do the work.

Accessibility

It is built on native elements and keeps aria-label, aria-hidden and aria-live 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/cart-flight.md

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

More in Surfaces