Componentdata0.85 KB gzipZero dependencies
Order Card
Order status card with step dots and item summary.
Preview
Live Preview
Order #102938Processing
Design Services1x
Development5x
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add order-cardOr install the full npm package:
npm install bigbulluiUsage
Open in StackBlitzimport { OrderCard } from "@/components/ui/order-card";
<OrderCard />Usage guidance
Use Order Card when a ticket stub surface needs Order status card with step dots and item summary. Keep props minimal and prefer composition with sibling stubs.
Avoid Order Card for long form flows or dense data grids where a dedicated layout block fits better.
Source code
order-card.tsxZero dependencies (only React + utils). Copy and paste directly into your project:
"use client";
import * as React from "react";
import { cn } from "./lib/utils";
export interface OrderCardProps {
orderId: string;
status: "Processing" | "Shipped" | "Delivered" | "Cancelled";
progress?: number;
items?: { label: string; qty: number }[];
className?: string;
}
const ProgressBar = "order-progress-bar";
const StatusEnter = "order-status-enter";
export function OrderCard({
orderId,
status = "Processing",
progress = 0,
items,
className,
}: OrderCardProps) {
return (
<div
className={cn(
"rounded-lg border border-foreground bg-card text-card-foreground p-6 transition-all duration-300 hover:translate-y-1 hover:shadow-lg motion-reduce:transition-none motion-reduce:translate-y-0 motion-reduce:shadow-none",
className
)}
>
<div className="flex items-baseline justify-between mb-4">
<span className="font-mono text-sm uppercase tracking-widest">Order {orderId}</span>
<span className={cn(
"px-2 py-0.5 rounded text-xs font-mono uppercase tracking-wider",
status === "Processing" && "bg-warning text-white",
status === "Shipped" && "bg-success text-white",
status === "Delivered" && "bg-success text-white",
status === "Cancelled" && "bg-destructive text-white",
StatusEnter
)}>
{status}
</span>
</div>
{/* Progress bar */}
{progress > 0 && progress < 1 && (
<div className="w-full bg-secondary/20 rounded-h-full h-2 mb-3 overflow-hidden">
<div
className={cn(
"h-full bg-accent rounded-h-full transition-width duration-500",
ProgressBar,
`w-${Math.min(progress * 100, 100)}%`
)}
/>
</div>
)}
{/* Items list */}
{items && items.length > 0 && (
<div className="space-y-2 text-sm">
{items.map((it, i) => (
<div key={i} className="flex items-baseline justify-between">
<span className="font-medium">{it.label}</span>
<span className="font-mono text-muted-foreground">{it.qty}x</span>
</div>
))}
</div>
)}
</div>
);
}Props
| Prop | Type | Description |
|---|---|---|
| orderId | string | |
| status | "Processing" | "Shipped" | "Delivered" | "Cancelled" | |
| progress? | number | |
| items? | { label: string | |
| qty | number }[] | |
| className? | string |