Search documentation

Search for a page or component.

Delta Badge

A signed percentage change with a trend icon, colored by whether the change is good.

+12.4%-3.2%0.0%+8.0%
+12.4%-3.2%0.0%
+12.4%-3.2%
import { DeltaBadge } from "@/components/ui/delta-badge"

export default function DeltaBadgeDemo() {

A small badge showing a signed percentage change with a trend icon, colored by whether the change is good. Every card in this registry uses it, and it can be inverted for metrics where a decrease is the good direction.

Installation

pnpm dlx shadcn@latest add @dashboardcn/delta-badge

Usage

import { DeltaBadge } from "@/components/ui/delta-badge"

<DeltaBadge delta={0.124} />
<DeltaBadge delta={0.08} invert />
<DeltaBadge delta={-0.032} variant="soft" />