Componentfeedback1.72 KB gzipZero dependencies

Trend Badge

Dynamic rate and velocity indicator badge with live pulse indicator.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add trend-badge

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { TrendBadge } from "@/components/ui/trend-badge"; <TrendBadge value="+24.8%" label="TICKET DEMAND" live />

Source code

trend-badge.tsx + 1 helper

Zero 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 />
PropTypeDescription
valuenumber | stringValue or percentage to display
trendTrendDirectionDirection of the trend
labelstringOptional label below value
timeframestringConfigures timeframe.
ratestringConfigures rate.
velocityTrendVelocityLevelConfigures velocity.
variantTrendBadgeVariantVisual style variant. (Default: "stamp")
sizeTrendBadgeSizeComponent size preset. (Default: "md")
livebooleanWhether to show live pulsing dot
notchedbooleanToggles notched. (Default: false)
animatedbooleanToggles animated. (Default: true)
stampAnglebooleanToggles stamp angle. (Default: false)
classNamestringOptional Tailwind or custom CSS classes merged with component styles.