Bar List (preview)
A component that combines a list with horizontal bars to visualize comparative values across categories.
/home84% of total traffic
843
/imprint5% of total traffic
46
/cancellation0% of total traffic
3
/blocks11% of total traffic
108
/documentation38% of total traffic
384
Automatic Installation
This method is still working on progress, please use manual installation for now.
Manual Installation
Copy the code
Usage
Imports
Example
Browse the Storybook for more examples.
Props
BarListProps
Prop | Type | Default |
---|---|---|
data? | BarItemProps[] | [] |
size? | sm | md | lg | md |
variant? | default | success | warning | destructive | info | default |
hideValue? | boolean | false |
hideTooltip? | boolean | false |
hideArrow? | boolean | false |
interactive? | boolean | false |
valueFormatter? | (value: number) => string | - |
onValueChange? | (item: BarItemProps) => void | - |
sortOrder? | ascending | descending | none | none |
showAnimation? | boolean | false |
className? | string | - |
BarItemProps
Prop | Type | Default |
---|---|---|
id? | string | number | - |
title? | string | required |
subtitle? | string | - |
value? | number | required |
maxValue? | number | 100 or auto-calculated from max value in data |
color? | string | - |
tooltip? | string | React.ReactNode | - |
formatValue? | (value: number) => string | - |
onClick? | () => void | - |
href? | string | - |
Edit on GitHub
Last updated on