Chart Bar Increasing

An animated Lucide-style bar chart icon in which a vertical and horizontal axis frame three horizontal bars of different lengths. On hover, the bars redraw in a staggered sequence, and a ref handle lets you trigger the same animation programmatically.

Chart Bar Increasing
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add https://lucide-animated.com/r/chart-bar-increasing.json

Usage

usage.tsx
import { ChartBarIncreasingIcon } from "@/components/ui/chart-bar-increasing";export default function Example() {  return <ChartBarIncreasingIcon />;}
  • Showing growth, increase, or upward trend in analytics, reports, or statistics cards
  • Adding a hover-triggered micro-interaction to a sidebar or menu item representing charts or metrics
  • Signaling a 'stats' or 'performance' section where a programmatic replay of the animation is useful, via the ref handle
  • Replacing a static bar-chart icon when a subtle animated affordance is desired

Examples

Hover animation (default)

Renders the icon with the built-in hover animation. The bars redraw when the pointer enters the wrapper div.

hover-animation-(default).tsx
import { ChartBarIncreasingIcon } from "@/components/ui/chart-bar-increasing";export default function HoverExample() {  return (    <div className="flex items-center gap-2 text-sm">      <ChartBarIncreasingIcon className="text-emerald-500" />      <span>Revenue growth</span>    </div>  );}

Programmatic control via ref

Uses the forwarded ref to call startAnimation and stopAnimation. Once a ref is attached, the built-in hover animation is disabled and onMouseEnter/onMouseLeave are forwarded to your callbacks instead.

programmatic-control-via-ref.tsx
import { useRef } from "react";import {  ChartBarIncreasingIcon,  type ChartBarIncreasingIconHandle,} from "@/components/ui/chart-bar-increasing";export default function ControlledExample() {  const iconRef = useRef<ChartBarIncreasingIconHandle>(null);  return (    <button      type="button"      className="inline-flex items-center gap-2 rounded-md border px-3 py-2"      onMouseEnter={() => iconRef.current?.startAnimation()}      onMouseLeave={() => iconRef.current?.stopAnimation()}      onFocus={() => iconRef.current?.startAnimation()}      onBlur={() => iconRef.current?.stopAnimation()}    >      <ChartBarIncreasingIcon ref={iconRef} size={20} />      View stats    </button>  );}

Labelled icon for screen readers

When the icon conveys meaning on its own, pass role and aria-label through the spread HTML attributes on the wrapper div.

labelled-icon-for-screen-readers.tsx
import { ChartBarIncreasingIcon } from "@/components/ui/chart-bar-increasing";export default function LabelledExample() {  return (    <ChartBarIncreasingIcon      role="img"      aria-label="Sales are increasing"      size={32}      className="text-blue-600"    />  );}

API reference

PropTypeDefaultDescription
sizenumber28Width and height of the rendered SVG in pixels. Applied to both the width and height attributes of the svg element.
classNamestring—Class names applied to the wrapper div via cn(). Use text-* utilities to change the stroke color, since the stroke is currentColor.
onMouseEnter(e: React.MouseEvent<HTMLDivElement>) => void—Mouse enter handler on the wrapper div. Called after the built-in animation runs when no ref is attached. When a ref is attached, it is called in place of the built-in animation.
onMouseLeave(e: React.MouseEvent<HTMLDivElement>) => void—Mouse leave handler on the wrapper div. When no ref is attached, the icon resets to its visible state. When a ref is attached, only this callback runs.
refReact.Ref<ChartBarIncreasingIconHandle>—Forwarded ref exposing startAnimation(): Promise<void>-like async function that replays the draw animation, and stopAnimation(): sets the icon to its visible state. Attaching a ref switches the component into controlled mode.
...HTMLAttributes<HTMLDivElement>HTMLAttributes<HTMLDivElement>—All other standard div attributes (id, style, role, aria-*, tabIndex, onClick, onFocus, etc.) are spread onto the wrapper div.

Accessibility

  • The SVG has no title, desc, or role, so screen readers may ignore it or announce nothing meaningful. If the icon is decorative, leave it as is or add aria-hidden="true" via props.
  • When the icon carries meaning, pass role="img" and an aria-label through the spread attributes on the wrapper div.
  • The animation is triggered by mouse hover only by default, which is not reachable by keyboard. Use the ref handle with onFocus/onBlur, or another keyboard-accessible trigger, to expose the same feedback.
  • Respect reduced-motion preferences by disabling startAnimation calls when prefers-reduced-motion is set, since the effect is a repeated line-draw motion.
  • Ensure the icon has sufficient contrast against its background, because it inherits currentColor and has a thin 2px stroke.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Chart Bar Increasing" component (lucide-animated/chart-bar-increasing) from its shadcn registry.1. Install it with: npx shadcn@latest add https://lucide-animated.com/r/chart-bar-increasing.json2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: size, className, onMouseEnter, onMouseLeave, ref, ...HTMLAttributes<HTMLDivElement>.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ChartBarIncreasingIcon } from "@/components/ui/chart-bar-increasing";export default function Example() {  return <ChartBarIncreasingIcon />;}```

Files & dependencies

  • chart-bar-increasing.tsx
dependenciesmotion

Looks similar, elsewhere