BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/loomui/icon-morph

Icon Morph

loomui/icon-morph
FreeComponent

One icon that turns into another by moving its own pieces, so there is never a frame with both glyphs on screen.

Live preview

live · rendered by the registry
Rendered by loomui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://loomui.design/r/icon-morph.json

Source

registry/loomui/icon-morph.tsxloomui.design/r/icon-morph.json · first 6 KB
1"use client"
2
3import * as React from "react"
4
5import { cn } from "@/lib/utils"
6
7/** Which pair of shapes the icon travels between. */
8export type IconMorphSet = "menu" | "plus" | "play" | "chevron"
9
10export interface IconMorphProps extends Omit<
11 React.ComponentProps<"svg">,
12 "children"
13> {
14 /** Which pair of shapes to morph between. */
15 set?: IconMorphSet
16 /** `false` shows the first shape, `true` the second. */
17 active?: boolean
18 /** Milliseconds for the morph. Set to `0` to turn it off. */
19 duration?: number
20 /** Stroke weight, in viewBox units. */
21 strokeWidth?: number
22}
23
24/**
25 * What each `set` travels between, and what `active` means.
26 *
27 * | set | active false | active true |
28 * | --------- | ------------ | ----------- |
29 * | `menu` | hamburger | close |
30 * | `plus` | plus | close |
31 * | `play` | play | pause |
32 * | `chevron` | chevron | tick |
33 */
34
35/**
36 * Shared by every piece that moves rather than reshapes. The duration is a
37 * custom property set on the root, so one prop reaches every part without
38 * being threaded through them.
39 *
40 * `motion-reduce:transition-none` is a class rather than an inline style on
41 * purpose: an inline `transition` would outrank it and the escape would not
42 * work.
43 */
44const SHIFT =
45 "transition-[transform,opacity] ease-out-quart [transition-duration:var(--icon-morph-duration)] motion-reduce:transition-none"
46
47/**
48 * SVG transforms resolve against the viewBox once `transform-box` says so.
49 * Firefox and Safari have both shipped a different initial value at some
50 * point, so it is stated rather than assumed.
51 */
52function pose(
53 origin: string,
54 transform?: string,
55 opacity?: number
56): React.CSSProperties {
57 return {
58 transformBox: "view-box",
59 transformOrigin: origin,
60 transform: transform ?? "none",
61 opacity,
62 }
63}
64
65/**
66 * Quartic ease out. `--ease-out-quart` is the cubic-bezier approximation of
67 * this curve, so driving the tween with the curve itself keeps the reshaping
68 * sets in step with the transforming ones.
69 */
70function easeOutQuart(t: number) {
71 return 1 - (1 - t) ** 4
72}
73
74function usePrefersReducedMotion() {
75 const [reduced, setReduced] = React.useState(false)
76
77 React.useEffect(() => {
78 const query = window.matchMedia("(prefers-reduced-motion: reduce)")
79 const read = () => setReduced(query.matches)
80 read()
81 query.addEventListener("change", read)
82 return () => query.removeEventListener("change", read)
83// … truncated

What it pulls in

Other registry items

  • utils

Files it writes

  • registry/loomui/icon-morph.tsx

Facts

Registry
loomui
Type
registry:ui
Access
Free
Files written
1
Theme wiring
ships cssVars
Licence
MIT
In the index
at or before 2026-08-20
Last confirmed
yesterday

Go to the source

Docs on loomui loomui.design rjcuff/Loom-UI on GitHub Raw registry item This item as JSON

More from loomui

All 91 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Aurora Backdropaurora-backdroploomuiComponentsFreeno deps
Bento Gridbento-gridloomuiComponentsFreeno deps
Card Stackcard-stackloomuiComponentsFreeno deps
Compare Slidercompare-sliderloomuiComponentsFreeno deps
Confetti Buttonconfetti-buttonloomuiComponentsFreeno deps
Count Upcount-uploomuiComponentsFreeno deps
Credit Cardcredit-cardloomuiComponentsFreeno deps
DrawerdrawerloomuiComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored on what can be checked

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex