← Back

Caret Right

Install

npm install @svg-animated-icons/react

CLI

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
FlagDescription
--dest <dir>Destination directory (default: components/animated-icons)

Or copy the component with the CLI

CLI
npx @svg-animated-icons/cli add caret-right --react

Code

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 CaretRightIcon({ disableHover, className }: Props) {
  const classes = [
    "ai-caret-right-icon",
    disableHover ? "no-hover" : "",
    className ?? "",
  ]
    .filter(Boolean)
    .join(" ");

  return (
    <>
      <style>{`
.ai-caret-right-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  cursor: pointer;
  overflow: visible;
}

.ai-caret-right-icon * {
  transform-box: fill-box;
}

.ai-caret-right-icon.no-hover * {
  transform: none;
  opacity: 1;
  animation: none;
}

.ai-caret-right-icon .caret {
  transform-origin: center;
}

.ai-caret-right-icon:not(.no-hover):hover .caret {
  animation: ai-caret-right-motion 700ms ease-in-out;
}

@keyframes ai-caret-right-motion {
  0%, 50%, 100% { transform: translate(0, 0); }
  25%, 75% { transform: translateX(1.5px); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="caret" d="M6 4L6 11L10.5 7.5Z" fill="currentColor"/>
      </svg>
    </>
  );
}