Componentdata0.93 KB gzipZero dependencies

Checkout Summary

Cart summary with quantity steppers, tax row and checkout CTA.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add checkout-summary

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CheckoutSummary } from "@/components/ui/checkout-summary"; <CheckoutSummary />

Source code

checkout-summary.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxcheckout-summary.tsx120 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CheckoutSummaryItem {  id: string;  title: string;  price: string;  qty: number;} export interface CheckoutSummaryProps extends React.HTMLAttributes<HTMLElement> {  items: CheckoutSummaryItem[];  subtotal?: string;  tax?: string;  total?: string;  cta?: string;

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { CheckoutSummary } from "@/components/ui/checkout-summary"; <CheckoutSummary />
PropTypeDescription
itemsCheckoutSummaryItem[]Structured list of items rendered by the component. (Default: [])
subtotalstringConfigures subtotal. (Default: "$0.00")
taxstringConfigures tax. (Default: "$0.00")
totalstringConfigures total. (Default: "$0.00")
ctastringConfigures cta. (Default: "Checkout")
classNamestringOptional Tailwind or custom CSS classes merged with component styles.
onQtyChange(id: string, qty: number) => voidCallback invoked on qty change.
onCheckout() => voidCallback invoked on checkout.