Skip to content

    Browse components

    Icon Shift

    Swaps one icon for another in place: the old one shrinks, blurs and turns away while the new one turns in and pops to size. Wrap any icon and change its key.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/icon-shift

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/icon-shift.json

    Usage

    import { IconShift } from "@/components/ui/icon-shift";
    
    <IconShift swapKey={copied}>
      {copied ? <Check /> : <Copy />}
    </IconShift>

    Props

    PropTypeDefaultDescription
    rotatenumber45Degrees the icons turn while swapping.
    blurnumber4Blur in px at the swap's start and end.
    shrinknumber0.4Scale the icons shrink to while swapping.
    durationnumber0.28Swap length in seconds.
    swapKeyReactNode—Identifies the current icon; changing it triggers the swap.
    classNamestring—Extra classes for the root element.