Icon Swap
Animate icon swaps with scale, blur, and fade transitions.
Installation
Install-Module cnpx -Scope CurrentUser -Force; Import-Module cnpx; cnpx add @chadnpc/icon-swapUsage
import { IconSwap, IconSwapItem } from "@/components/icon-swap"<IconSwap>
<IconSwapItem key={isCopied ? "check" : "copy"}>
{isCopied ? <CheckIcon /> : <CopyIcon />}
</IconSwapItem>
</IconSwap>Change the key on IconSwapItem whenever the icon should swap.
Composition
Use the following composition to build an IconSwap
IconSwap
└── IconSwapItem
└── {icon}