# Ecommerce Shopping Cart: Sidebar Cart

A cart that slides in from the side as a panel over the page, listing items and totals. Keeps shopping in view while customers adjust quantities and pay.

- Page: https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/sidebar-cart
- Collection: [Ecommerce](https://www.shadcn-ui-blocks.com/blocks/ecommerce), Free tier
- Group: [Shopping Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart)
- Created: 2026-06-14
- Preview image: https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/sidebar-cart.png

## Install

```bash
npx shadcn@latest add @shadcn-ui-blocks/ecommerce-shopping-cart-sidebar-cart
```

A free block: it installs with no account or key. Or install it by URL: `npx shadcn@latest add "https://www.shadcn-ui-blocks.com/r/ecommerce-shopping-cart-sidebar-cart.json"`.

## Depends on

- npm packages: class-variance-authority, lucide-react, radix-ui
- shadcn/ui components: badge, button, progress, separator
- Installs to: `@/components/blocks/ecommerce/shopping-cart/sidebar-cart`

## About this block

Sidebar Cart is a panel that slides in over the right edge of the page. A
header row shows the cart title, a live item count, and a close button.
Below it, a progress bar tracks progress toward free shipping and
switches to a confirmation line once the threshold clears. The scrollable
middle section lists each product with a thumbnail, name, color and size
details, plus and minus steppers capped at stock limits, a trash icon,
and a live line total with the original price struck through when
discounted. A pinned footer holds the subtotal, shipping, and total, then
checkout and continue shopping buttons. A floating shopping bag button
with a count badge reappears when the panel is closed.

All copy, prices, and product details are plain state, so you can swap in
real catalog data without touching layout, and each footer button can be
wired up independently. Note that the free shipping threshold appears in
two places, a named constant behind the progress bar and a hardcoded
amount in the shipping fee check, so update both together.

## When to use

Reach for this panel wherever a customer adds items and wants to review
the cart without losing their place. For a product analytics SaaS selling
plan upgrades or extra seats, a user can open their pending order,
confirm quantities, and move to payment without leaving the dashboard
they were reading. It outperforms a dedicated cart page when the buying
decision is quick and context matters.

A natural flow around it on an Ecommerce page:

**Before**

- A [Product List](https://www.shadcn-ui-blocks.com/blocks/ecommerce/product-list) page where customers
  browse and trigger the cart panel repeatedly.
- A [Mini Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/mini-cart) instead, for
  a quick summary from the cart icon rather than a panel.

**After**

- A [Modern Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/modern-cart) page for
  shoppers who want a bigger review surface before they pay.
- A [Cross Sells](https://www.shadcn-ui-blocks.com/blocks/ecommerce/ecommerce-cross-sells) block to
  surface related items just before the final checkout step.

## What you can customize

Three distinct zones you can adapt independently:

- **Free shipping bar.** Raise or lower the threshold and the bar and
  its message follow; the shipping fee check carries its own copy of the
  amount.
- **Item rows.** Each row renders from a plain object, so you can add or
  remove fields like size or color.
- **Footer actions.** Both buttons are standard button components, so
  point them at any route or open a modal instead.

> Tip: if your catalog never carries discounts, drop the original price
> field and the struck through line disappears cleanly from every row.

## More in Ecommerce Shopping Cart

- [Compact Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/compact-cart)
- [Floating Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/floating-cart)
- [Mini Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/mini-cart)
- [Modern Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/modern-cart)
- [Sticky Cart](https://www.shadcn-ui-blocks.com/blocks/ecommerce/shopping-cart/sticky-cart)
