arrow-back-icon
itshover/arrow-back-iconFreeComponent
itshover publishes no description for this item.
Install it
npx shadcn@latest add https://itshover.com/r/arrow-back-icon.jsonSource
1import { forwardRef, useImperativeHandle } from "react";2import type { AnimatedIconHandle, AnimatedIconProps } from "./types";3import { motion, useAnimate } from "motion/react";45const ArrowBackIcon = forwardRef<AnimatedIconHandle, AnimatedIconProps>(6 (7 { size = 24, color = "currentColor", strokeWidth = 2, className = "" },8 ref,9 ) => {10 const [scope, animate] = useAnimate();1112 const start = async () => {13 await animate(14 ".arrow-group",15 { x: [0, -3, 0] },16 { duration: 0.4, ease: "easeInOut" },17 );18 };1920 const stop = () => {21 animate(".arrow-group", { x: 0 }, { duration: 0.2, ease: "easeOut" });22 };2324 useImperativeHandle(ref, () => {25 return {26 startAnimation: start,27 stopAnimation: stop,28 };29 });3031 const handleHoverStart = () => {32 start();33 };3435 const handleHoverEnd = () => {36 stop();37 };3839 return (40 <motion.div41 ref={scope}42 onHoverStart={handleHoverStart}43 onHoverEnd={handleHoverEnd}44 className={`inline-flex cursor-pointer items-center justify-center ${className}`}45 >46 <svg47 xmlns="http://www.w3.org/2000/svg"48 width={size}49 height={size}50 viewBox="0 0 24 24"51 fill="none"52 stroke={color}53 strokeWidth={strokeWidth}54 strokeLinecap="round"55 strokeLinejoin="round"56 >57 <motion.g className="arrow-group">58 <path stroke="none" d="M0 0h24v24H0z" fill="none" />59 <path d="M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1" />60 </motion.g>61 </svg>62 </motion.div>63 );64 },65);6667ArrowBackIcon.displayName = "ArrowBackIcon";6869export default ArrowBackIcon;
What it pulls in
npm packages
Files it writes
More from itshover
All 263 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accessibility-iconaccessibility-icon | itshover | Components | Free | 1 dep · 2 files | |
| airplane-iconairplane-icon | itshover | Components | Free | 1 dep · 2 files | |
| alarm-clock-plus-iconalarm-clock-plus-icon | itshover | Components | Free | 1 dep · 2 files | |
| align-center-iconalign-center-icon | itshover | Components | Free | 1 dep · 2 files | |
| align-vertical-space-around-iconalign-vertical-space-around-icon | itshover | Components | Free | 1 dep · 2 files | |
| ambulance-iconambulance-icon | itshover | Components | Free | 1 dep · 2 files | |
| ampersand-iconampersand-icon | itshover | Components | Free | 1 dep · 2 files | |
| angry-iconangry-icon | itshover | Components | Free | 1 dep · 2 files |
