BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/loomui/spool

Spool

loomui/spool
FreeComponent

A container that changes shape to fit whatever it is showing, on a spring that carries its velocity through an interruption.

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/spool.json

Source

registry/loomui/spool.tsxloomui.design/r/spool.json · first 6 KB
1"use client"
2
3import * as React from "react"
4
5import { cn } from "@/lib/utils"
6import { useSpring, type SpringOptions } from "@/registry/lib/use-spring"
7
8export interface SpoolProps extends Omit<
9 React.ComponentProps<"div">,
10 "children"
11> {
12 /** Which state is showing. */
13 value: string
14 /** One entry per state. Whatever is not `value` is not in the DOM. */
15 children: React.ReactNode
16 /** How the shape travels between states. */
17 spring?: SpringOptions
18 /** Corner radius in pixels. Kept circular through the morph. */
19 radius?: number
20 /** Milliseconds the outgoing state stays mounted for. */
21 fade?: number
22}
23
24export interface SpoolItemProps extends React.ComponentProps<"div"> {
25 /** Matches the `value` on the parent. */
26 value: string
27}
28
29/** Milliseconds the outgoing state takes to leave. */
30const EXIT_MS = 120
31/** Milliseconds a piece takes to arrive once the old state has gone. */
32const ENTER_MS = 170
33/** Milliseconds between one piece landing and the next. */
34const STAGGER_MS = 45
35
36/**
37 * One state's contents. Sized by whatever is inside it: the shape follows the
38 * content rather than the content being poured into a shape.
39 */
40export function SpoolItem({
41 value: _value,
42 className,
43 ...props
44}: SpoolItemProps) {
45 return (
46 <div
47 data-slot="spool-item"
48 className={cn("flex items-center gap-2.5 px-4 py-2.5", className)}
49 {...props}
50 />
51 )
52}
53
54function findItem(children: React.ReactNode, value: string) {
55 let found: React.ReactElement<SpoolItemProps> | null = null
56
57 React.Children.forEach(children, (child) => {
58 if (
59 !found &&
60 React.isValidElement<SpoolItemProps>(child) &&
61 child.props.value === value
62 ) {
63 found = child
64 }
65 })
66
67 return found as React.ReactElement<SpoolItemProps> | null
68}
69
70/**
71 * A shape that changes to fit what it holds.
72 *
73 * The size is never animated. The box is set once, in the commit that swaps the
74 * contents, and the difference replays as a transform: start at the ratio
75 * between old and new, spring to 1. Layout runs once per change.
76 */
77export function Spool({
78 value,
79 children,
80 spring,
81 radius = 999,
82 fade = 200,
83 className,
84 style,
85 ...props
86}: SpoolProps) {
87 const rootRef = React.useRef<HTMLDivElement>(null)
88 const wrapRef = React.useRef<HTMLDivElement>(null)
89 // The root is never laid out at its animated size, so its own offset box is
90 // always the natural size of the contents. That is what makes a remeasure
91// … truncated

What it pulls in

Other registry items

  • utils
  • use-spring

Files it writes

  • registry/loomui/spool.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