Staaarter

Billing Cart Mini

A small cart preview for showing selected plans and add-ons before checkout. Line items scroll inside a fixed-height list, a running subtotal sits above the checkout button, and an optional secondary link sends people back to browsing. Built for sidebar overlays and sticky headers where a full cart page would be overkill.

By Staaarter Team
Billing
Updated February 18, 2026
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button, scroll-area dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/billing-cart-mini.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing31.tsx instead.

Usage

The file also exports billing31Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Billing31, billing31Demo } from "@/components/blocks/billing/billing31";

export default function Page() {
  return <Billing31 {...billing31Demo} />;
}

Props

PropTypeDefaultDescription
titlestring"Your cart"Heading shown in the header, next to the item count badge.
itemsCartLineItem[]noneLine items rendered in the order given. An empty array shows a plain empty-cart message instead of the list.
subtotalLabelstring"Subtotal"Label for the running total row above the checkout button.
subtotalstringnonePreformatted subtotal amount, for example "$67.00".
checkoutLabelstring"Checkout"Label for the primary checkout button.
checkoutHrefstringnoneDestination for the checkout button, rendered as a next/link.
continueShoppingLabelstring"Continue browsing"Label for the optional secondary link.
continueShoppingHrefstringnoneWhen set, renders a secondary link below the checkout button.
classNamestringnoneExtra classes for the outer container.

Types

interface CartLineItem {
  id: string;
  name: string;
  description?: string;
  price: string;
  period?: string; // e.g. "/mo" or "once"
  quantity?: number;
}

Behavior notes

  • The item list sits inside a ScrollArea capped at max-h-72, so it scrolls internally once there are more items than fit rather than growing the whole block.
  • Quantity is only shown as a "2x" prefix on the item name when quantity is greater than 1; there's no built-in increment or decrement control.
  • The subtotal and every line item price are plain strings, so currency formatting, rounding, and totals math are entirely up to the caller.
  • Both the checkout and continue-browsing actions render as next/link, not buttons with onClick handlers, matching this category's other href-driven blocks.
  • An empty items array replaces the list with a centered "Your cart is empty" message; the checkout button still renders underneath it.

Frequently asked questions