Package Box

A pure CSS 3D cardboard package box featuring interactive tape-splitting physics, flap-folding choreography, and an animated packing slip that rises out and turns to face the viewer.

Click or tap the box or button to unfold 3D flaps and reveal packing slip. Fully responsive on mobile.

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/package-box

API Reference

PropTypeDefaultDescription
openbooleanundefinedControlled open state of the package box
defaultOpenbooleanfalseInitial open state for uncontrolled usage
onOpenChange(open: boolean) => voidundefinedCallback triggered when open state changes
childrenReactNodeundefinedCustom React elements to render inside the rising document paper
slipPackageSlipDEFAULT_SLIPStructured metadata for the default shipping invoice / packing slip
maxWidthnumber460Maximum width in px; the 3D scene scales down responsively
colorsPackageBoxColorsundefinedColor overrides for box cardboard, tape, paper, ink, and accent stamp
labelReactNode | falseundefinedCustom shipping label or false to hide
symbolsReactNode | falseundefinedCustom fragile/handling symbols or false to hide
tapebooleantrueWhether packing tape across top and seam is rendered
hintbooleantrueWhether to show the accessible toggle button below the box
openLabelstring'Click to open'Accessible label when closed
closeLabelstring'Close'Accessible label when open
reserveSpacebooleanfalseWhether to preserve full open height while closed to avoid layout shifts
classNamestring''Optional CSS class names for outer wrapper
paperClassNamestring''Optional CSS class names for the document paper