CartDrawer

Shopping cart slide-out drawer. Place once at site root level. Visibility is driven by the `cart:open` state key — any Button with `action: { type: "toggle-cart" }` flips it (or `action: { type: "set-state", key: "cart:open", value: "shown" }` for explicit open). The optional backdrop reads the same key via `Container.visibilityStateKey: "cart:open"`. Shows cart items with quantity controls, subtotal, and checkout button.

Supports Children: any

Structure

Children: Container (header: title text + close Button with action toggle-cart), Container (footer: checkout Button with action cart-checkout + continue shopping Button with action toggle-cart). Cart items render automatically between header and footer from cart state. Quantity controls and remove buttons are component-rendered.

Properties

PropertyTypeDescriptionExamples
positionstring
right | left
Which side the drawer slides in from
Default: "right"
-
showBackdropboolean
Show a semi-transparent backdrop behind the drawer
Default: true
-
canDeleteboolean
-
Default: true
-
canEditNameboolean
-
Default: true
-
customobject
-
-
classNamestring
Tailwind classes for the drawer container
flex flex-col