presentation-chart-line
An animated presentation-chart-line icon for React: a presentation board with a rising line graph that draws itself on hover. It is built with motion and exposes an imperative ref for starting and stopping the animation.
shadcn add · no workarounds · theme neutral (none shipped)Installation
Requires @heroicons-animated in the registries of your components.json (shadcn adds official directory namespaces automatically).
Usage
import { PresentationChartLineIcon } from "@/components/ui/presentation-chart-line";export function Example() { return <PresentationChartLineIcon size={28} />;}- Showing reports, presentations, dashboards, or analytics summaries where a chart-on-a-board metaphor fits
- Adding a subtle hover micro-interaction to a navigation item, card, or button that represents statistics or growth
- Triggering the line-drawing animation programmatically (for example on data load or a tab switch) through the exposed ref
- Replacing a static presentation-chart icon where a lively, modern feel is wanted
Examples
Hover-animated icon in a stat label
The icon animates when the pointer enters its wrapper div. It inherits color from the text color via currentColor.
import { PresentationChartLineIcon } from "@/components/ui/presentation-chart-line";export function MonthlyGrowth() { return ( <div className="flex items-center gap-2 text-sky-600"> <PresentationChartLineIcon size={32} /> <span className="font-medium">Monthly growth</span> </div> );}Controlled animation via ref
Use the exported handle type to start and stop the animation from a parent button. Hover on the icon itself no longer animates once the ref is attached.
import { useRef } from "react";import { Button } from "@/components/ui/button";import { PresentationChartLineIcon, type PresentationChartLineIconHandle,} from "@/components/ui/presentation-chart-line";export function ReportButton() { const iconRef = useRef<PresentationChartLineIconHandle>(null); return ( <Button variant="outline" onMouseEnter={() => iconRef.current?.startAnimation()} onMouseLeave={() => iconRef.current?.stopAnimation()} > <PresentationChartLineIcon ref={iconRef} size={16} /> Report </Button> );}Play animation on mount
Start the line-drawing animation once after the component mounts, for example when a dashboard section appears.
import { useEffect, useRef } from "react";import { PresentationChartLineIcon, type PresentationChartLineIconHandle,} from "@/components/ui/presentation-chart-line";export function DashboardHeader() { const iconRef = useRef<PresentationChartLineIconHandle>(null); useEffect(() => { iconRef.current?.startAnimation(); }, []); return <PresentationChartLineIcon ref={iconRef} size={24} className="text-indigo-500" />;}API reference
Accessibility
- The component renders a plain decorative SVG with no title or role; if it conveys meaning on its own, wrap it with role="img" and an aria-label on the wrapper div, or pass the label via aria-label through props.
- If the icon is purely decorative next to visible text, pass aria-hidden="true" so screen readers skip it.
- Animation is triggered only by pointer hover or by code; there is no keyboard trigger, so do not rely on hover alone to reveal information. Provide the same information in text.
- The motion is a one-time 0.4s line draw and does not loop, which keeps it low-distraction. Consider disabling programmatic startAnimation calls when the user prefers reduced motion.
- The icon uses currentColor, so it keeps sufficient contrast when the surrounding text color meets WCAG contrast requirements.
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.
Use the "presentation-chart-line" component (heroicons-animated/presentation-chart-line) from its shadcn registry.1. Install it with: npx shadcn@latest add @heroicons-animated/presentation-chart-line2. 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 { PresentationChartLineIcon } from "@/components/ui/presentation-chart-line";export function Example() { return <PresentationChartLineIcon size={28} />;}```Files & dependencies
- presentation-chart-line.tsx