Componentfeedback0.45 KB gzipZero dependencies
Stock Status
Stock status badge: in stock, low stock pulse, sold out.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add stock-statusOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { StockStatus } from "@/components/ui/stock-status"; <StockStatus />Source code
stock-status.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxstock-status.tsx40 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface StockStatusProps extends React.HTMLAttributes<HTMLSpanElement> { /** mevcut stok */ stock: number; /** Low stock warning threshold */ lowAt?: number; labelInStock?: string;} /** Stock availability indicator: in-stock / low / out of stock + pulse. */export function StockStatus({ stock, lowAt = 5, labelInStock = "In stock", className, ...props }: StockStatusProps) { const out = stock <= 0; const low = stock > 0 && stock <= lowAt; Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { StockStatus } from "@/components/ui/stock-status"; <StockStatus />| Prop | Type | Description |
|---|---|---|
| stock | number | mevcut stok |
| lowAt | number | Low stock warning threshold |
| labelInStock | string | Configures label in stock. (Default: "In stock") |