TidalUI

Sparkline preview

Show a compact ordered trend with exact start, end and change context.

pro · Data · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/sparkline

Import components/ui/tidal.css, components/ui/sparkline.css. Wrap installed components in tidal-scope.

Preview

Sparkline component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/sparkline.css";
import{TidalSparkline}from"./components/ui/sparkline";
export default()=><div className="tidal-scope"><TidalSparkline label={"Demo"} points={[{id:"example",label:"Demo",value:1}]}/></div>;

API and props

TidalSparkline.label (required)
string

Required label value accepted by this exported component.

TidalSparkline.points (required)
ReadonlyArray<TidalSparklinePoint>

Required points value accepted by this exported component.

TidalSparkline.activePointId
string | null | undefined

Optional active point id value accepted by this exported component.

TidalSparkline.changeContent
ReactNode

Optional change content value accepted by this exported component.

TidalSparkline.changeLabel
string | undefined

Optional change label value accepted by this exported component.

TidalSparkline.changeUnavailableText
string | undefined

Optional change unavailable text value accepted by this exported component.

TidalSparkline.defaultActivePointId
string | null | undefined

Optional default active point id value accepted by this exported component.

TidalSparkline.emptyContent
ReactNode

Optional empty content value accepted by this exported component.

TidalSparkline.endLabel
string | undefined

Optional end label value accepted by this exported component.

TidalSparkline.formatValue
((value: number) => string) | undefined

Optional format value value accepted by this exported component.

TidalSparkline.inspectable
boolean | undefined

Optional inspectable value accepted by this exported component.

TidalSparkline.onActivePointChange
((pointId: string, point: TidalSparklinePoint, source: TidalSparklineInspectSource, event: MouseEvent<HTMLButtonElement>) => void) | undefined

Callback invoked when the active point change interaction is proposed.

TidalSparkline.startLabel
string | undefined

Optional start label value accepted by this exported component.

TidalSparkline.tableCaption
string | undefined

Optional table caption value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas