Icon Swap
ncdai/icon-swapUnverifiedComponent
Animate icon swaps with scale, blur, and fade transitions.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/exekartik/exeKartik/main/icon-swap.jsonSource
1"use client"23import type { AnimatePresenceProps, HTMLMotionProps } from "motion/react"4import { AnimatePresence, motion } from "motion/react"56export function IconSwap(props: React.PropsWithChildren<AnimatePresenceProps>) {7 return <AnimatePresence mode="popLayout" initial={false} {...props} />8}910type MotionElement = typeof motion.div | typeof motion.span1112export function IconSwapItem({13 as: Component = motion.div,14 ...props15}: HTMLMotionProps<"div"> & {16 as?: MotionElement17}) {18 return (19 <Component20 initial={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}21 animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}22 exit={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}23 transition={{24 type: "spring",25 duration: 0.3,26 bounce: 0,27 }}28 {...props}29 />30 )31}
What it pulls in
npm packages
Files it writes
More from ncdai
All 17 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Apple Hello Effectapple-hello-effect | ncdai | Components | Unverified | 1 dep | |
| Apple Hello Effect - Hindiapple-hello-effect-hindi | ncdai | Components | Unverified | 1 dep | |
| Apple Hello Effect - Spanishapple-hello-effect-spanish | ncdai | Components | Unverified | 1 dep | |
| Apple Hello Effect - Vietnameseapple-hello-effect-vietnamese | ncdai | Components | Unverified | 1 dep | |
| Brand Assets Menubrand-assets-menu | ncdai | Components | Unverified | 1 dep | |
| chevrons-up-down-iconchevrons-up-down-icon | ncdai | Components | Unverified | 1 dep | |
| Code Block Commandcode-block-command | ncdai | Components | Unverified | 4 deps · 3 files | |
| Consent Managerconsent-manager | ncdai | Components | Unverified | 1 dep · 2 files |
