chevrons-up-down-icon
lyminhnghia/chevrons-up-down-iconFreeComponent
TBD
Install it
npx shadcn@latest add https://lyminhnghia.github.io/r/chevrons-up-down-icon.jsonSource
1"use client"23import { motion, useAnimation } from "motion/react"4import { forwardRef, useImperativeHandle } from "react"56export type ChevronsUpDownIconHandle = {7 startAnimation: () => void8 stopAnimation: () => void9}1011export type ChevronsUpDownIconProps = React.ComponentProps<"svg"> & {12 duration?: number13}1415const ChevronsUpDownIcon = forwardRef<16 ChevronsUpDownIconHandle,17 ChevronsUpDownIconProps18>(({ duration = 0.3, ...props }, ref) => {19 const controls = useAnimation()2021 useImperativeHandle(ref, () => {22 return {23 startAnimation: () => controls.start("animate"),24 stopAnimation: () => controls.start("normal"),25 }26 })2728 return (29 <svg30 xmlns="http://www.w3.org/2000/svg"31 width="24"32 height="24"33 viewBox="0 0 24 24"34 fill="none"35 stroke="currentColor"36 strokeWidth="2"37 strokeLinecap="round"38 strokeLinejoin="round"39 aria-hidden40 {...props}41 >42 <motion.path43 d="M7 15L12 20L17 15"44 variants={{45 normal: {46 d: "M7 15L12 20L17 15",47 },48 animate: {49 d: "M7 20L12 15L17 20",50 },51 }}52 initial="normal"53 animate={controls}54 transition={{55 duration,56 }}57 />58 <motion.path59 d="M7 9L12 4L17 9"60 variants={{61 normal: {62 d: "M7 9L12 4L17 9",63 },64 animate: {65 d: "M7 4L12 9L17 4",66 },67 }}68 initial="normal"69 animate={controls}70 transition={{71 duration,72 }}73 />74 </svg>75 )76})7778ChevronsUpDownIcon.displayName = "ChevronsUpDownIcon"7980export { ChevronsUpDownIcon }
Files it writes
More from lyminhnghia
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Apple Hello Effectapple-hello-effect | lyminhnghia | Components | Free | 1 dep | |
| Code Block Commandcode-block-command | lyminhnghia | Components | Free | 4 deps · 3 files | |
| Consent Managerconsent-manager | lyminhnghia | Components | Free | 1 dep | |
| Copy Buttoncopy-button | lyminhnghia | Components | Free | 2 deps · 2 files | |
| GitHub Starsgithub-stars | lyminhnghia | Components | Free | no deps | |
| Scroll Fade Effectscroll-fade-effect | lyminhnghia | Components | Free | no deps | |
| Shimmering Textshimmering-text | lyminhnghia | Components | Free | 1 dep | |
| Slide to Unlockslide-to-unlock | lyminhnghia | Components | Free | 1 dep |
