uibrik

Range Line

Preview

Customize

1M
Accent

Usage

import { RangeLine } from "@/components/uibrik/range-line/range-line";

<RangeLine />

Installation

npx shadcn@latest add https://uibrik.com/r/range-line.json
Adds the files to components/uibrik/range-line and installs @number-flow/react, @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/range-line.

Props

RangeLine
title
Type string
"Portfolio"
Names what is plotted.
defaultRange
Type "1D" | "1W" | "1M" | "3M" | "1Y"
"1M"
Range shown first.
trend
Type boolean
true
Green when the range ends up, red when down.
accent
Type string
""
Line colour when trend is off. Empty uses the chart palette.
ranges
Type { value: string; label: string; data: { label: string; value: number }[]; period?: string }[]
–
One tab per range, each with its own points, oldest first.
range
Type string
–
Range shown, when controlled.
onRangeChange
Type (range: string) => void
–
Called when a tab is picked.
format
Type Intl.NumberFormatOptions
USD currency
Formats every number, e.g. { style: "percent" }.
className
Type string
–
Classes for the outer shell.