Componentfeedback1.72 KB gzipZero dependencies
Trend Badge
Dynamic rate and velocity indicator badge with live pulse indicator.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add trend-badgeOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { TrendBadge } from "@/components/ui/trend-badge"; <TrendBadge value="+24.8%" label="TICKET DEMAND" live />Source code
trend-badge.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxtrend-badge.tsx298 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type TrendDirection = "up" | "down" | "neutral";export type TrendVelocityLevel = "low" | "medium" | "high" | "surge" | 1 | 2 | 3 | 4;export type TrendBadgeVariant = "stamp" | "outline" | "solid" | "subtle";export type TrendBadgeSize = "sm" | "md" | "lg"; export interface TrendBadgeProps extends React.HTMLAttributes<HTMLDivElement> { value: number | string; trend?: TrendDirection; label?: string; timeframe?: string; rate?: string; velocity?: TrendVelocityLevel; variant?: TrendBadgeVariant;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { TrendBadge } from "@/components/ui/trend-badge"; <TrendBadge />| Prop | Type | Description |
|---|---|---|
| value | number | string | Value or percentage to display |
| trend | TrendDirection | Direction of the trend |
| label | string | Optional label below value |
| timeframe | string | Configures timeframe. |
| rate | string | Configures rate. |
| velocity | TrendVelocityLevel | Configures velocity. |
| variant | TrendBadgeVariant | Visual style variant. (Default: "stamp") |
| size | TrendBadgeSize | Component size preset. (Default: "md") |
| live | boolean | Whether to show live pulsing dot |
| notched | boolean | Toggles notched. (Default: false) |
| animated | boolean | Toggles animated. (Default: true) |
| stampAngle | boolean | Toggles stamp angle. (Default: false) |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |