Skip to Content

Trend Chip

A small percentage change in green with an up arrow, or red with a down arrow.

+12.4% ↑-3.2% ↓
import { TrendChip } from "@dapplelight/signet-ui/domain/trend-chip"

export function TrendChipDemo() {
  return (
    <div className="flex items-center gap-4">
      <TrendChip value={12.4} />
      <TrendChip value={-3.2} />
    </div>
  )
}

Installation

npm i @dapplelight/signet-ui

Usage

import { TrendChip } from "@dapplelight/signet-ui/domain/trend-chip"

<TrendChip value={12.4} />

Examples

Up and down

+12.4% ↑-3.2% ↓
import { TrendChip } from "@dapplelight/signet-ui/domain/trend-chip"

export function TrendChipDemo() {
  return (
    <div className="flex items-center gap-4">
      <TrendChip value={12.4} />
      <TrendChip value={-3.2} />
    </div>
  )
}

Beside a figure

Monthly recurring revenue
₹8.4L+8.7% ↑
import { TrendChip } from "@dapplelight/signet-ui/domain/trend-chip"

export function TrendChipInStatDemo() {
  return (
    <div className="flex flex-col gap-1">
      <span className="text-sm text-neutral-500">Monthly recurring revenue</span>
      <div className="flex items-baseline gap-2">
        <span className="text-3xl font-semibold">₹8.4L</span>
        <TrendChip value="8.7" className="text-sm" />
      </div>
    </div>
  )
}

Non-numeric and zero

—+0.0% ↑
import { TrendChip } from "@dapplelight/signet-ui/domain/trend-chip"

export function TrendChipFallbackDemo() {
  return (
    <div className="flex items-center gap-4">
      <TrendChip value="n/a" />
      <TrendChip value={0} />
    </div>
  )
}

API Reference

TrendChip

PropTypeDefaultDescription
valuenumber | string—The change in percent. Strings are parsed; a non-number shows a dash.
classNamestring—Merged over the 11px default.