Stock Badge
A one-line live stock status: a check for in stock, a red dot with the units left for low stock, a clock for made to order.
npx shadcn@latest add https://ui.develop-better-solutions.com/r/stock-badge.jsonDependencies:
lucide-reactIn stockShips in 2 to 4 days
Only 3 leftShips in 2 to 4 days
Made to orderDelivered in about 3 weeks
Out of stock
Usage
stock-badge-example.tsx
import { StockBadge } from "@dbs/ui";
export default function StockBadgeExample() {
return (
<div className="flex flex-col gap-4">
<StockBadge status="in-stock" detail="Ships in 2 to 4 days" />
<StockBadge status="low" quantity={3} detail="Ships in 2 to 4 days" />
<StockBadge status="made-to-order" detail="Delivered in about 3 weeks" />
<StockBadge status="out" />
</div>
);
}