Xzero UI
Pro library

Cart drawerPro

Products fly into the cart, counts roll, and a drawer handles quantities, shipping progress, and checkout.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/cart-drawer
Live · keyboard ready

Use this as a starting point and replace the sample data with your own.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/cart-drawer

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { CartDrawer } from "@/components/xzero/blocks/cart-drawer/cart-drawer";

export function ShopPage() {
  return <CartDrawer />;
}

API reference

CartDrawer

A product grid with a slide-in cart. Adding an item arcs its photo into the cart button, lines can be swiped away, a free shipping bar fills, promo codes validate, and the checkout button folds into a confirmation disc. Products, prices, and the order are sample data; checkout is simulated. Also the default export.

No props.

Keyboard interactions

KeysAction
Enter / SpaceAdds a product, opens the cart, and runs the quantity, remove, and checkout buttons.
EscapeCloses the drawer, except while an order is being placed. Focus returns to the cart button.
Enter (promo field)Applies the promo code.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components