shadcn.io is not affiliated with official shadcn/ui
Drawer examples · Right
Right Drawer Shopping Cart for React
A right drawer shopping cart with three items, remove buttons, a subtotal, shipping and total, and Checkout.
A cart in a right drawer: three items with their variant, price and a remove button, then the subtotal, shipping and total, and Checkout with Continue Shopping in the footer. Shoppers check the cart without leaving the product they're on.
Preview
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.
Related
- Simple Right DrawerA drawer that slides in from the right
- Right Drawer NotificationsA right drawer listing notifications
- Left Drawer with SearchA left drawer with a search field above
- Right Drawer Filter PanelA right drawer of product filters
- Right Drawer Settings PanelA right drawer of settings switches
- Bottom Drawer Event DetailsA bottom drawer with an event's badges