Skip to content
caliper ui docs

Pro

Box pack

An order being packed. Each item drops into the open box in turn and disappears behind its front, the lid comes down, tape sweeps across it and a Packed tag settles on the front.

Pro
pnpm dlx shadcn@latest add @caliper/box-pack

Order 2041

Four things, one box.

Ready to pack
Installs components/ui/box-pack.tsxDepends on none beyond ReactMotion none in component source

When to use

Use it for

  • Order confirmation and fulfilment screens.
  • A packing step in a warehouse or returns flow.

Skip it when

  • Boxes with more than four items; summarise instead.
  • Status that changes back and forth quickly.

Decisions

Why it is built this way, so you know what to keep when you change your copy.

Behaviour

Staged by delays, not timers
Each step waits on the one before through transition delays, so setting the flag back to false unwinds everything at once.

Usage

The state is text
The line under the box says what is happening, as a status, and the drawing is hidden from assistive technology.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/box-pack

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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { BoxPack } from "@/components/ui/box-pack"

The worked example comes with Pro

The 32-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

BoxPack

component

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

PropTypeDefaultDescription
packed *boolean—Packs the box when true and unpacks it when false.
itemsReactNode[]["Shirt", "Mug", "Book"]Up to four things that go in, each a short label or small glyph.
labels{ packing: string; packed: string; }{ packing: "Ready to pack", packed: "Packed" }The line under the box, per state.

Accessibility

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

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

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Surfaces examples