Component libraryBar chart
Bar chart
ProCompare grouped or stacked values with exact readings, negative values and a data table.
npx shadcn@latest add @tidal-pro/bar-chartInstallation
Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.
Terminal
Import components/ui/tidal.css, components/ui/bar-chart.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.
Usage
Complete example source · Dependency and asset manifest
Loading the complete example…
API & behavior
Data categories and series require stable unique IDs and readable labels. Each category maps series IDs to numeric values; null, undefined and nonfinite values display No data. Optional headingLevel h2 through h6 (default h3), grouped/stacked mode, description, formatValue, emptyMessage and native section attrs/ref. Signed bars share one zero baseline; stacked positive and negative values accumulate separately. Scale normalization keeps finite extreme numbers drawable. Exact formatted values remain beside each row and in a complete semantic table, which opens with the shared Button. Native category buttons inspect the selected record on pointer, focus or activation; their accessible name includes every series value. The default formatter displays at most two fractional digits; provide an appropriate formatter for units and precision. Consumers own data, labels, units and formatting; no fetching or analytics calculation is performed.
Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.