Skip to content

v1.4.0

Latest

Choose a tag to compare

@ChrisUser ChrisUser released this 11 Apr 20:03
· 1 commit to main since this release
3d6c142

Features

  • Added animated transitions: segments smoothly animate width changes (animated, transitionDuration props)
  • Added hover tooltips: tooltips appear only on hover with segment highlight effect (showTooltipOnHover)
  • Added custom rendering: renderTooltip and renderSegment props for full control over content
  • Added segment gap: configurable spacing between segments with per-segment border radius (segmentGap, segmentBorderRadius)
  • Added gradient colors support: color prop now supports CSS gradients (linear-gradient(...), radial-gradient(...))
  • Added configurable dimensions: height and borderRadius props to control bar size without CSS overrides
  • Added remaining space label: remaining prop to display and label unused space in the bar
  • Added onItemClick callback that fires when a bar segment is clicked
  • Added RTL support
  • Added improved a11y compatibility

Fixes

  • Division by zero: getPercentageValue now returns "0%" when total is 0 instead of rendering NaN%
  • SSR hydration mismatch: removed non-deterministic Math.random() shuffle from fallback color assignment, preventing server/client mismatches in Next.js, Remix, and other SSR frameworks
  • CSS injection prevention: user-supplied color values are validated and rejected if they contain url(), expression(), javascript:, or @import patterns
  • Tooltip text overflow: long item names are now truncated with ellipsis via CSS instead of breaking tooltip layout
  • Single-segment border radius: fixed CSS where a bar with only one segment had asymmetric border radius