Skip to content
Hazine

Mini Cart Bottom Sheet

Pro

Mobile cart that rises from the bottom edge and rests at two heights. Half height shows the subtotal and checkout, full height adds every line with quantity controls.

How it differs. Bottom sheet with two snap heights and the summary above the lines, so checkout is reachable at half height. Each drag (expand, collapse, dismiss) has a button equivalent.

pnpm dlx shadcn@latest add @hazine/mini-cart-bottom-sheet

Adds 2 files, 2 shadcn primitives (button, drawer), 2 Hazine items (@hazine/heading, @hazine/use-controllable-state), and 1 package (lucide-react).

First time? Add the registry to components.json
{
  "registries": {
    "@hazine": {
      "url": "https://api.hazine.dev/r/{name}.json",
      "headers": { "Authorization": "Bearer ${HAZINE_TOKEN}" }
    }
  }
}

Set HAZINE_TOKEN in your environment. The token comes with a Pro licence.

Props15

title
string = "Your cart"
headingLevel
HeadingLevel = 2
open
boolean
defaultOpen
boolean = false
onOpenChange
(open: boolean) => void
snap
CartSheetSnap
Resting height of the sheet. Dragging and the items button both set it.
defaultSnap
CartSheetSnap = "half"
onSnapChange
(snap: CartSheetSnap) => void
lines
CartLine[]
defaultLines
CartLine[] = DEFAULT_LINES
onLinesChange
(lines: CartLine[]) => void
loading
boolean = false
Replaces figures and lines with skeletons and holds the checkout action.
currency
string = "EUR"
locale
string = "en-US"
checkoutHref
string = "/checkout"

Also accepts every prop of Omit< React.ComponentProps<"div">, "title" >.

Accessibility

Keyboard
Keyboard support for Mini Cart Bottom Sheet
KeyEffect
Enter or Space on the cart buttonOpens the sheet at half height and moves focus to the close button
Tab, Shift+TabCycles through close, checkout and the items button, and at full height also through product link, decrease, increase and remove for each line, without leaving the sheet. On a screen too short to show a control at half height, focusing it raises the sheet to full height
Enter or Space on Items and quantitiesRaises the sheet to full height and shows the lines, or lowers it back to half height. Focus stays on the button, or moves to the close button when the screen is too short to show it at half height
Enter or Space on Decrease or IncreaseChanges the quantity by 1. At a bound the button stays focusable and does nothing
Enter or Space on RemoveRemoves the line and moves focus to the line that takes its place, or to the empty state heading
EscapeCloses the sheet and returns focus to the cart button
Screen reader

Modal dialog named by its heading and described by the cart contents. A disclosure button sets the sheet height and names the lines it controls, which are hidden from sight, the tab order and assistive tech at half height. Focus on a control below the screen edge raises the sheet, so focus is never off screen. Quantity is a named group of two labelled buttons, the subtotal sits in a status region and removal is announced.

  • Announces: {name} removed from cart.
  • Announces: Subtotal, {count} items {subtotal}
Reduced motion
Hazine adds colour transitions only: the chevron turns without a transition and the loading skeleton and spinner stay still. The slide of the sheet between heights and on open and close is drawn by the host drawer primitive (vaul), which has no reduced motion setting, so it still runs.
Checked
Not checked yet. Automated results appear here once CI has run.

Dependencies5

  • button
  • drawer
  • @hazine/heading
  • @hazine/use-controllable-state
  • lucide-react

Filled chips are registry items the CLI adds for you. Outlined chips are npm packages.

Tokens shipped0

None. The item is styled by the tokens your theme already has.

Other takes on this3

The same question answered with a different structure.

  • mini carts

    Trigger and panel are one surface that grows from pill to panel, with no overlay, backdrop or focus trap. It leaves the page while the cart is empty and takes an edge offset to clear page controls.

    shadcn add @hazine/mini-cart-floating-pill

    Depends on badge, button, @hazine/heading, @hazine/use-controllable-state, lucide-react

  • mini carts

    Non-modal popover on its trigger with no editing: only the newest lines are listed, older ones fold into one summed row that links to the cart, and the page behind stays usable.

    shadcn add @hazine/mini-cart-header-popover

    Depends on badge, button, popover, @hazine/heading, lucide-react

  • mini carts

    Modal side sheet with three fixed zones: header with count and shipping meter, scrolling lines, pinned subtotal footer. Focus is trapped while open and returns to the cart button.

    shadcn add @hazine/mini-cart-side-drawer

    Depends on button, sheet, @hazine/heading, @hazine/use-controllable-state, lucide-react

More in Carts and Checkout