Comparison Bar Card
This period vs last as paired bars: a segmented control slides a pill between Week, Month and Year while bars re-grow on a spring, and hovering or focusing a pair lifts it with both values.
Try it: Switch the range (← → in the control); hover or Tab the bars.
Installation
Install with the shadcn CLI:
npx shadcn@latest add https://www.framekitui.live/r/comparison-bar-card.jsonOr, with the @framekit namespace registered: npx shadcn@latest add @framekit/comparison-bar-card. You can also copy the source into components/ui/comparison-bar-card.tsx (view on GitHub).
Usage
import { ComparisonBarCard } from '@/components/ui/comparison-bar-card'Props
| Prop | Type | Default | Notes |
|---|---|---|---|
ranges | Record<string, ComparisonSeries[]> | Week / Month / Year | { label, current, previous } |
defaultRange | string | 'Week' | Starting range. |
title / currency | string | Revenue / '
|