Ruler Horizontal
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 ruler-horizontal --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 RulerHorizontalIcon({ disableHover, className }: Props) {
const classes = [
"ai-ruler-horizontal-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-ruler-horizontal-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-ruler-horizontal-icon * {
transform-box: fill-box;
}
.ai-ruler-horizontal-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
.ai-ruler-horizontal-icon .ruler {
transform-origin: center;
}
.ai-ruler-horizontal-icon:not(.no-hover):hover .ruler {
animation: ai-ruler-horizontal-measure 700ms ease-in-out;
}
@keyframes ai-ruler-horizontal-measure {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-1px); }
75% { transform: translateX(1px); }
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="ruler" d="M14.6006 4.00977C14.8286 4.05629 15 4.25829 15 4.5V10.5C15 10.7761 14.7761 11 14.5 11H0.5C0.223858 11 0 10.7761 0 10.5V4.5L0.00976562 4.39941C0.056292 4.17145 0.258287 4 0.5 4H14.5L14.6006 4.00977ZM1 10H14V5H12.9248V6.5C12.9248 6.73472 12.7347 6.9248 12.5 6.9248C12.2653 6.9248 12.0752 6.73472 12.0752 6.5V5H10.9248V6.5C10.9248 6.73472 10.7347 6.9248 10.5 6.9248C10.2653 6.9248 10.0752 6.73472 10.0752 6.5V5H8.9248V7.5C8.9248 7.73472 8.73472 7.9248 8.5 7.9248C8.26528 7.9248 8.0752 7.73472 8.0752 7.5V5H6.9248V6.5C6.9248 6.73472 6.73472 6.9248 6.5 6.9248C6.26528 6.9248 6.0752 6.73472 6.0752 6.5V5H4.9248V6.5C4.9248 6.73472 4.73472 6.9248 4.5 6.9248C4.26528 6.9248 4.0752 6.73472 4.0752 6.5V5H2.9248V7.5C2.9248 7.73472 2.73472 7.9248 2.5 7.9248C2.26528 7.9248 2.0752 7.73472 2.0752 7.5V5H1V10Z" fill="currentColor"/>
</svg>
</>
);
}