Componentfeedback0.45 KB gzipZero dependencies

Stock Status

Stock status badge: in stock, low stock pulse, sold out.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add stock-status

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { StockStatus } from "@/components/ui/stock-status"; <StockStatus />

Source code

stock-status.tsx + 1 helper

Zero 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 />
PropTypeDescription
stocknumbermevcut stok
lowAtnumberLow stock warning threshold
labelInStockstringConfigures label in stock. (Default: "In stock")