Align Center Horizontally
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 align-center-horizontally --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 AlignCenterHorizontallyIcon({ disableHover, className }: Props) {
const classes = [
"ai-align-center-horizontally-icon",
disableHover ? "no-hover" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<>
<style>{`
.ai-align-center-horizontally-icon {
width: 1em;
height: 1em;
display: inline-block;
cursor: pointer;
overflow: visible;
}
.ai-align-center-horizontally-icon * {
transform-box: fill-box;
}
.ai-align-center-horizontally-icon:not(.no-hover):hover .left-fill,
.ai-align-center-horizontally-icon:not(.no-hover):hover .right-fill {
animation: ai-align-center-horizontally-motion 700ms ease-in-out;
}
.ai-align-center-horizontally-icon.no-hover * {
transform: none;
opacity: 1;
animation: none;
}
@keyframes ai-align-center-horizontally-motion {
0%,
100% {
transform: translateY(0);
}
33% {
transform: translateY(-1.25px);
}
66% {
transform: translateY(1.25px);
}
}
`}</style>
<svg
xmlns="http://www.w3.org/2000/svg"
className={classes}
viewBox="0 0 15 15"
fill="none"
>
<path className="guide" d="M7.5 1.5V13.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round"/>
<rect className="left-fill" x="1" y="6" width="6.5" height="3" rx="0.7" fill="currentColor"/>
<rect className="right-fill" x="7.5" y="6" width="6.5" height="3" rx="0.7" fill="currentColor"/>
</svg>
</>
);
}