shadcn.io is an independent project built on shadcn/ui
Cart (3) opens a right panel. Wireless Headphones, a USB-C cable, and a phone case each have a price and a remove button. The total reads $157.00, then Checkout and Continue Shopping.
Use it so shoppers can check the cart without leaving the product. A long cart belongs on a page, not in a Sheet. In Vue, Ark UI does not update the total.
Installation
Anatomy

Usage
<Drawer swipeDirection="right">
<DrawerTrigger :asChild="true">
<Button variant="outline">
<ShoppingCartIcon aria-hidden="true" data-icon="inline-start" />Cart (3)
</Button>
</DrawerTrigger>
<DrawerContent :showBar="false">
<DrawerHeader>
<DrawerTitle>Shopping Cart</DrawerTitle>
<DrawerDescription>3 items in your cart</DrawerDescription>
</DrawerHeader>
<div class="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4">
<ul class="flex flex-col gap-4">
<li v-for="item in CART_ITEMS" class="flex gap-4 border-b pb-4" :key="item.id">
<div class="size-20 shrink-0 rounded-md bg-muted"></div>
<div class="flex flex-1 flex-col gap-1">
<h3 class="font-medium text-sm">{{ item.name }}</h3>
<p class="text-muted-foreground text-xs">{{ item.variant }}</p>
<div class="flex items-center justify-between">
<span class="font-medium text-sm">{{ item.price }}</span>
<Button :aria-label="`Remove ${item.name}`" size="icon-xs" variant="ghost">
<Trash2Icon aria-hidden="true" />
</Button>
</div>
</div>
</li>
</ul>
<dl class="flex flex-col gap-2 text-sm">
<div class="flex justify-between">
<dt class="text-muted-foreground">Subtotal</dt>
<dd>$147.00</dd>
<!-- The rest of the file is under Installation. -->FAQ
What does each cart item show?
An image placeholder, the name, the variant, the price and an icon-only remove button. The items come from a static array with an id each for the key.
How is the remove button labeled?
It's icon-only, so aria-label names the item, such as Remove Wireless Headphones. The trash icon is aria-hidden.
Are the totals calculated?
No, they're written out: $147.00, $10.00 and $157.00, in a description list. Compute them from your cart and format them with Intl.NumberFormat.
What do Checkout and Continue Shopping do?
Continue Shopping is a DrawerClose, so it dismisses the drawer. Checkout has no handler: send people to your checkout from it.
API Reference
Drawer
Sets swipeDirection="right" and asChild. The rest is on the Drawer page.
Button
Sets variant="outline", aria-label="`Remove ${item.name}`", size="icon-xs" and variant="ghost". The rest is on the Button page.





