Icon Morph Demo
loomui/icon-morph-demoFreeExample
Five icon pairs, each one shape travelling rather than two shapes trading places.
Install it
npx shadcn@latest add https://loomui.design/r/icon-morph-demo.jsonSource
1"use client"23import * as React from "react"45import { IconMorph, type IconMorphSet } from "@/registry/loomui/icon-morph"67const SETS: { set: IconMorphSet; off: string; on: string }[] = [8 { set: "menu", off: "Open menu", on: "Close menu" },9 { set: "plus", off: "Add thread", on: "Cancel" },10 { set: "play", off: "Play", on: "Pause" },11 { set: "chevron", off: "Continue", on: "Done" },12]1314export default function IconMorphDemo() {15 const [active, setActive] = React.useState<Record<string, boolean>>({})1617 return (18 <div className="flex flex-col items-center gap-4">19 <div className="flex items-center gap-2">20 {SETS.map(({ set, off, on }) => (21 <button22 key={set}23 type="button"24 aria-pressed={active[set] ?? false}25 aria-label={active[set] ? on : off}26 onClick={() =>27 setActive((current) => ({ ...current, [set]: !current[set] }))28 }29 className="ease-out-quart text-foreground/70 hover:text-foreground flex size-11 items-center justify-center transition-colors duration-180"30 >31 <IconMorph set={set} active={active[set] ?? false} />32 </button>33 ))}34 </div>35 <p className="text-muted-foreground text-xs">36 One shape the whole way. Nothing crossfades.37 </p>38 </div>39 )40}
What it pulls in
Other registry items
Files it writes
More from loomui
All 91 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora Backdrop Demoaurora-backdrop-demo | loomui | Examples | Free | no deps | |
| Bento Grid Demobento-grid-demo | loomui | Examples | Free | no deps | |
| Card Stack Democard-stack-demo | loomui | Examples | Free | no deps | |
| Compare Slider Democompare-slider-demo | loomui | Examples | Free | no deps | |
| Confetti Button Democonfetti-button-demo | loomui | Examples | Free | no deps | |
| Count Up Democount-up-demo | loomui | Examples | Free | no deps | |
| Credit Card Democredit-card-demo | loomui | Examples | Free | no deps | |
| Drawer Demodrawer-demo | loomui | Examples | Free | no deps |
