BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ridiculous/transition-editor

Transition + Animation Editor

ridiculous/transition-editor
FreeComponent

Ridiculously typed CSS transition + animation editor (mode prop) — a comma-separated layer list with per-kind token typing and cardinality caps. Live preview that actually animates, with an embedded easing picker and duration scrubber.

Install it

npx shadcn@latest add http://ridiculous.turtlesocks.dev/r/transition-editor.json

Source

src/components/ui/transition-editor/transition-editor.tsxridiculous.turtlesocks.dev/r/transition-editor.json · first 6 KB
1"use client"
2
3import { useEffect, useRef, useState } from "react"
4import { Button } from "@/components/ui/button"
5import {
6 Popover,
7 PopoverContent,
8 PopoverTrigger,
9} from "@/components/ui/popover"
10import { cn } from "@/lib/utils"
11import { AddLayerButton } from "./controls"
12import { AnimationFields, TransitionFields } from "./fields"
13import { TransitionPreview } from "./preview"
14import {
15 defaultAnimationLayer,
16 defaultTransitionLayer,
17 formatAnimation,
18 formatTransition,
19 layerCount,
20 parseAnimation,
21 parseTransition,
22} from "./transition-editor.helpers"
23import type {
24 AnimationLayer,
25 AnimationString,
26 EditorMode,
27 TransitionEditorState,
28 TransitionEditorStringMap,
29 TransitionLayer,
30 TransitionString,
31} from "./transition-editor.types"
32
33// ---------------------------------------------------------------------------
34// Mode-keyed helper indirection
35// ---------------------------------------------------------------------------
36
37type AnyLayer = TransitionLayer | AnimationLayer
38
39/**
40 * Parse a value into a discriminated `{ mode, layers }` state, or `null` on a
41 * parse error. The `mode` literal tags the layer list so downstream `format`
42 * narrows the element type without a cast.
43 */
44function parseState(
45 mode: EditorMode,
46 value: string,
47): TransitionEditorState | null {
48 if (mode === "transition") {
49 const layers = parseTransition(value)
50 return layers === null ? null : { mode, layers }
51 }
52 const layers = parseAnimation(value)
53 return layers === null ? null : { mode, layers }
54}
55
56/** Serialize a discriminated editor state. The `mode` tag narrows `layers`. */
57function formatState(state: TransitionEditorState): string {
58 return state.mode === "transition"
59 ? formatTransition(state.layers)
60 : formatAnimation(state.layers)
61}
62
63/** A fresh default layer for the mode. */
64function defaultLayerFor(mode: EditorMode): AnyLayer {
65 return mode === "transition"
66 ? defaultTransitionLayer()
67 : defaultAnimationLayer()
68}
69
70/**
71 * Re-tag a working `AnyLayer[]` as a discriminated `{ mode, layers }` state.
72 *
73 * This is the ONE place the editor asserts the layer kind matches the mode —
74 * unavoidable because the public `TransitionLayerRow` exposes an untagged
75 * `layer: AnyLayer` alongside a separate `mode` prop, so the type system cannot
76 * prove their correspondence. The editor only ever stores layers of the
77 * matching kind (parse + defaults + per-mode fields all produce them), so the
78// … truncated

What it pulls in

Other registry items

  • ridiculous-type-kit
  • easing-picker
  • unit-input
  • button
  • popover
  • input
  • label
  • select

Files it writes

  • src/components/ui/transition-editor/index.ts
  • src/components/ui/transition-editor/transition-editor.tsx
  • src/components/ui/transition-editor/transition-editor.types.ts
  • src/components/ui/transition-editor/transition-editor.helpers.ts
  • src/components/ui/transition-editor/controls.tsx
  • src/components/ui/transition-editor/fields.tsx
  • src/components/ui/transition-editor/preview.tsx

Facts

Registry
ridiculous
Type
registry:ui
Access
Free
Files written
7
Licence
MIT
In the index
at or before 2026-08-10
Last confirmed
today

Go to the source

ridiculous.turtlesocks.dev TurtIeSocks/ridiculous on GitHub Raw registry item This item as JSON

More from ridiculous

All 22 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
All ridiculous componentsallridiculousComponentsFreeno deps
Anchor Position Editoranchor-position-editorridiculousComponentsFreeno deps · 9 files
Background Editorbackground-editorridiculousComponentsFreeno deps · 9 files
Box Shadow Editorbox-shadow-editorridiculousComponentsFreeno deps · 7 files
Calc Editorcalc-editorridiculousComponentsFreeno deps · 4 files
Clip Path Editorclip-path-editorridiculousComponentsFreeno deps · 20 files
Color Functioncolor-functionridiculousComponentsFreeno deps · 10 files
Color Pickercolor-pickerridiculousComponentsFreeno deps · 11 files

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

ToolDrift

What the AI coding tools changed last night

tooldrift.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 ToolDrift

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 ToolDrift

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 ToolDrift

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