BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ridiculous/shape-path-editor

Shape Path Editor

ridiculous/shape-path-editor
FreeComponent

Ridiculously typed editor for the CSS shape() function (clip-path / offset-path). The strict tier dispatches each command on its name (move/line/curve/arc/…), checking arity, direction, and every coordinate. Ships the registry's only Bézier-control-handle canvas with a live preview.

Install it

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

Source

src/components/ui/shape-path-editor/shape-path-editor.tsxridiculous.turtlesocks.dev/r/shape-path-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 { CommandRow } from "./command-row"
12import { ShapeCanvas } from "./shape-canvas"
13import {
14 defaultShape,
15 formatShape,
16 parseShape,
17} from "./shape-path-editor.helpers"
18import type {
19 ShapeCommand,
20 ShapeString,
21 ShapeValue,
22} from "./shape-path-editor.types"
23import { ShapePreview } from "./shape-preview"
24
25// Re-export the public sub-components + their prop types so consumers (and the
26// barrel) can import them from `./shape-path-editor`.
27export type { CommandRowProps } from "./command-row"
28export { CommandRow } from "./command-row"
29export type { MiniSelectProps } from "./mini-select"
30export { MiniSelect } from "./mini-select"
31export type { ShapeCanvasProps } from "./shape-canvas"
32export { ShapeCanvas } from "./shape-canvas"
33export type { ShapePreviewMode, ShapePreviewProps } from "./shape-preview"
34export { ShapePreview } from "./shape-preview"
35
36// ---------------------------------------------------------------------------
37// Shared props
38// ---------------------------------------------------------------------------
39
40export type ShapePathEditorMode = "clip-path" | "offset-path"
41
42export interface ShapePathEditorPanelProps {
43 value: ShapeString | (string & {})
44 onChange: (value: ShapeString) => void
45 /**
46 * Which CSS property the live preview targets. Both `clip-path` and
47 * `offset-path` share the identical `shape()` grammar, so this does NOT
48 * change validation or narrow the `onChange` output — it only drives the
49 * preview render. Defaults to `"clip-path"`.
50 */
51 mode?: ShapePathEditorMode
52 className?: string
53 "aria-label"?: string
54}
55
56export interface ShapePathEditorProps extends ShapePathEditorPanelProps {}
57
58// ---------------------------------------------------------------------------
59// ShapePathEditor — popover-wrapped
60// ---------------------------------------------------------------------------
61
62export function ShapePathEditor(props: ShapePathEditorProps) {
63 const {
64 value,
65 className,
66 "aria-label": ariaLabel = "Edit a shape() path",
67 } = props
68 const parsed = parseShape(String(value))
69 const label =
70 parsed.error !== null
71 ? "invalid"
72 : `${parsed.commands.length} cmd${parsed.commands.length === 1 ? "" : "s"}`
73
74 return (
75 <Popover>
76// … truncated

What it pulls in

Other registry items

  • ridiculous-type-kit
  • unit-input
  • button
  • popover
  • input
  • label

Files it writes

  • src/components/ui/shape-path-editor/index.ts
  • src/components/ui/shape-path-editor/shape-path-editor.tsx
  • src/components/ui/shape-path-editor/shape-path-editor.types.ts
  • src/components/ui/shape-path-editor/shape-path-editor.helpers.ts
  • src/components/ui/shape-path-editor/shape-canvas.tsx
  • src/components/ui/shape-path-editor/command-row.tsx
  • src/components/ui/shape-path-editor/shape-preview.tsx
  • src/components/ui/shape-path-editor/mini-select.tsx

Facts

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

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

KitGrade

SaaS starter kits, scored from measured facts

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