Bar Chart
Install
npm install @svg-animated-icons/reactCLI
Copy an icon component straight into your project — shadcn-style. Replace {icon} with an icon name like arrow-left.
terminal
npx @svg-animated-icons/cli add {icon} --react| Flag | Description |
|---|---|
--dest <dir> | Destination directory (default: components/animated-icons) |
Or copy the component with the CLI
CLI
npx @svg-animated-icons/cli add bar-chart --reactCode
React
// Generated by @svg-animated-icons/cli
// You own this file — edit it freely.
import React from "react";
type Props = {
disableHover?: boolean;
className?: string;
};
export function BarChartIcon({ disableHover, className }: Props) {
const classes = [
"ai-bar-chart-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-bar-chart-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-bar-chart-icon * {
transform-box: fill-box;
}
.ai-bar-chart-icon .bar {
transform-origin: center bottom;
}
.ai-bar-chart-icon:not(.no-hover):hover .bar-1 { animation: ai-bar-chart-1 700ms ease-in-out; }
.ai-bar-chart-icon:not(.no-hover):hover .bar-2 { animation: ai-bar-chart-2 700ms ease-in-out; }
.ai-bar-chart-icon:not(.no-hover):hover .bar-3 { animation: ai-bar-chart-3 700ms ease-in-out; }
.ai-bar-chart-icon:not(.no-hover):hover .bar-4 { animation: ai-bar-chart-4 700ms ease-in-out; }
.ai-bar-chart-icon:not(.no-hover):hover .bar-5 { animation: ai-bar-chart-5 700ms ease-in-out; }
.ai-bar-chart-icon:not(.no-hover):hover .bar-6 { animation: ai-bar-chart-6 700ms ease-in-out; }
.ai-bar-chart-icon:not(.no-hover):hover .bar-7 { animation: ai-bar-chart-7 700ms ease-in-out; }
.ai-bar-chart-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
@keyframes ai-bar-chart-1 {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(0.85); }
}
@keyframes ai-bar-chart-2 {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(1.08); }
}
@keyframes ai-bar-chart-3 {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(1.18); }
}
@keyframes ai-bar-chart-4 {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(0.75); }
}
@keyframes ai-bar-chart-5 {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(0.92); }
}
@keyframes ai-bar-chart-6 {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(1.1); }
}
@keyframes ai-bar-chart-7 {
0%, 100% { transform: scaleY(1); }
50% { transform: scaleY(0.82); }
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<rect className="bar bar-1" x="1" y="5" width="1" height="9" rx="0.5" fill="currentColor"/>
<rect className="bar bar-2" x="3" y="7" width="1" height="7" rx="0.5" fill="currentColor"/>
<rect className="bar bar-3" x="5" y="4" width="1" height="10" rx="0.5" fill="currentColor"/>
<rect className="bar bar-4" x="7" y="5" width="1" height="9" rx="0.5" fill="currentColor"/>
<rect className="bar bar-5" x="9" y="3" width="1" height="11" rx="0.5" fill="currentColor"/>
<rect className="bar bar-6" x="11" y="1" width="1" height="13" rx="0.5" fill="currentColor"/>
<rect className="bar bar-7" x="13" y="3" width="1" height="11" rx="0.5" fill="currentColor"/>
</svg>
</>
);
}