Arc
ComponentsBlocksDocsPricingTry the demo
Introduction
Installation
Theming
Motion
AI and MCP
Changelog
Metrics dashboard
KPI drilldownNew
Metric explorer
Revenue explorer
MRR waterfall
Cohort retention
Usage forecast
Journey flow
Connected scatterNew
Market terminalNew
Budget varianceNew
Small multiplesNew
Line replayNew
AI chatNew
AI composer
Agent runNew
SidebarPro4
Page header
Command palette
Notification center
Empty states
Login and sign up5
OTP input
Multi-step formPro
Settings page
Security settings
Billing overview
Usage billingNew
Team members
Invite peopleNew
Team directory
Roles and permissions
API keys
Webhooks
Integrations
Plan comparison
Pricing calculatorNewPro
Usage pricingPro
Cart drawerNewPro
Checkout summaryNewPro
Invoice studio
Wallet card
Product listingNew
Product detailNew
Inbox triage
Support conversation
Support widget
File upload
Media playerPro
Week calendarNew
Availability picker
Project board
Release readiness
Hero sectionNew
Hero signupNewPro
Scroll storyNewPro
Spotlight gridNewPro
Feature bentoNewPro
Comparison tableNew
Logo marquee
Studio perspectivesPro
Stats bandNew
Changelog feed
FAQ sectionNew
Contact sectionNew
Team showcasePro
Blog gridNew
Site headerNew
Site footerNew
CTA sectionNew
Newsletter signupNew
Revenue globe
Customer galaxy
Semantic zoom
Layout morph
What’s new80 new
BlocksCart drawer

Cart drawerPro

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

Live block · sample data

When to use

  • Product listings where people add several items and review them in a side cart.
  • Stores that show a free shipping threshold and promo codes before checkout.
  • Demos of an add to cart interaction with clear feedback on where the item went.

When not to use

  • Use checkout-flow for a full multi-step checkout with address and payment.
  • Use checkout-summary when you only need the order summary and totals.
  • Use drawer for a generic side panel that is not a cart.

Installation

Pro source and install commands unlock with a Pro plan.

Usage

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

example.tsx
1import { CartDrawer } from "@/registry/blocks/cart-drawer/cart-drawer";2 3export function ShopPage() {4  return <CartDrawer />;5}
Built fromMotion

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

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

Accessibility

  • The cart button has aria-haspopup="dialog", aria-expanded, and a label with the item count. The drawer is role="dialog" with aria-modal and moves focus to its close button.
  • The shop behind an open drawer is inert, and the drawer body is inert while an order is placing.
  • Quantity steppers are labelled groups; the minus button becomes "Remove" at quantity one. Swipe to remove has button equivalents.
  • The shipping bar is a role="progressbar"; an invalid promo sets aria-invalid and swaps the note under the field.
  • Adds, removals, promo changes, and the placed order are announced in a polite live region.

Motion

  • The product photo flies along a quadratic arc into the cart over 780ms, shrinking and tilting; the badge count only changes when it lands, then the cart bumps and rings.
  • The drawer slides in on a critically damped spring. Rows collapse in height when removed and the totals roll with AnimatedCounter.
  • Swipe a row left past 110px, or flick it, to remove; short drags snap back with the release velocity.
  • The checkout button shares a layoutId with the confirmation disc, then a checkmark draws in.
  • Reduced motion skips the flight and the bump, disables row dragging, fades the drawer instead of sliding it, and zeroes the remaining springs.

Responsive behavior

  • The root is a size container. Above 640px the grid has three columns; at 640px and below it has two, with tighter padding.
  • At 380px and below the cart label hides, prices stack under names, and the drawer fills the block with a 4px inset.
  • Rows accept horizontal drag with direction lock, so vertical scrolling in the drawer still works on touch.

Performance

  • Each flight is driven by one motion value and transforms, not React state per frame; several flights can overlap.
  • The drawer and scrim only mount while open; timers are cleared on unmount.
  • Product images use next/image with sizes for 50vw on small screens and 260px otherwise.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Use for an ecommerce page where adding to cart and reviewing the cart happen without leaving the grid.
  • Replace PRODUCTS (with PhotoId images from @/lib/media) and the FREE_SHIPPING, SHIPPING, and PROMO constants; swap the image source for your own URLs if needed.
  • There are no props. Connect the add, setQty, remove, applyPromo, and checkout functions to your cart store and payment flow; checkout currently waits 1.3s and shows a sample receipt.
  • Composes Arc Button and AnimatedCounter.
/components/blocks/cart-drawer/markdown

The full library index for assistants is at /llms.txt.

Related

Checkout summaryProBlockAn order summary with a promo code that becomes a chip, discount and tax lines, and pay button states.DrawerComponentA temporary side surface for focused work.Swipe actionsComponentReveal row actions with a swipe, or from the same actions in a menu.Number fieldComponentEnter a bounded number with clear increment controls.
PreviousInvite peopleNextPricing calculator
Arc · 75 block pagesllms.txt

On this page

  • Preview
  • When to use
  • When not to use
  • Installation
  • Usage
  • API reference
  • Keyboard
  • Accessibility
  • Motion
  • Responsive behavior
  • Performance
  • Notes for AI
  • Related
View as Markdown

New in the studio

  • A woven oak lounge chair with a sheepskin and linen cushion on a concrete floor

    Oak lounge chair

    $1,240

    Woven oak, sheepskin

  • A white mushroom table lamp glowing beside books and a small vase

    Dome table lamp

    $186

    Opal glass, 2700K

  • A hand pouring water from a ribbed glass carafe into tumblers

    Ribbed carafe

    $64

    Mouth-blown glass, 1 L

  • Two speckled stoneware cups with a lid on a pale table

    Stoneware cups

    $48

    Set of two, speckled

  • Two stacked speckled ceramic bowls against a dark wall

    Nesting bowls

    $56

    Glazed stoneware, pair

  • Folded natural linen throws with fringed edges in soft window light

    Linen throw

    $118

    Stonewashed, fringed