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-uiUsage
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
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | string | ā | The change in percent. Strings are parsed; a non-number shows a dash. |
className | string | ā | Merged over the 11px default. |