Skip to content
KaufmannCommerce UI
Foundations · v0.1⌘ K

Kaufmann Commerce UI / Transaction family

Storefront Cart

Pluggable cart surfaces — a compact popover, a full-height drawer, and the inline panel — over one headless projection (useStorefrontCart). Swappable without changing page wiring.

Cart popover

The compact default: drops down at the cart control instead of covering the page. Add an Offer, or open it from its own trigger button.

Live specimen

One projection, several bodies

useStorefrontCart owns the projected quantities and the frontend event seam: it consumes data-add-offer clicks and kaufmann:cart-open, and broadcasts kaufmann:cart-updated. CartPopover, CartDrawer and the inline CartPanel are interchangeable views over that state. CartLines is the shared line-item list they compose.

None of these surfaces claims a reservation, inventory mutation, tax calculation, payment session or accepted backend Order.

Astro
---
import { CartDrawer, CartPopover } from "@kaufmann/ui";
---

<!-- pick ONE cart surface per page; both share the same events -->
<CartDrawer client:load offers={offers} />
<CartPopover client:load offers={offers} anchor=".k-cart-trigger" />

The drawer, when a page wants the full-height body

The drawer (historically StorefrontCart, now an alias of CartDrawer) remains available for compositions where the cart should command the page edge. It answers the same events, so switching surfaces is a one-line change.