BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ridiculous/clip-path-editor

Clip Path Editor

ridiculous/clip-path-editor
FreeComponent

Ridiculously typed CSS clip-path / shape-outside editor for a single <basic-shape> (inset / circle / ellipse / polygon) with an optional geometry-box keyword, validated by compile-time basic-shape dispatch through ParseFunction. Ships a tolerant runtime parser and a live preview with draggable polygon vertices.

Install it

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

Source

src/components/ui/clip-path-editor/clip-path-editor.tsxridiculous.turtlesocks.dev/r/clip-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 type { ClipMode } from "./clip-path-editor.constants"
12import {
13 defaultShape,
14 formatClipPath,
15 parseClipPath,
16 shapeToCss,
17} from "./clip-path-editor.helpers"
18import type {
19 BasicShapeName,
20 ClipPathShapeState,
21 ClipPathState,
22 ClipPathString,
23 GeometryBox,
24} from "./clip-path-editor.types"
25import { ShapeControls } from "./controls/shape-controls"
26import { ClipPathPreview } from "./preview/clip-path-preview"
27import { GeometryBoxSelect } from "./primitives/geometry-box-select"
28import { LiveString } from "./primitives/live-string"
29import { ShapeSelect } from "./primitives/shape-select"
30
31// ---------------------------------------------------------------------------
32// Shared props
33// ---------------------------------------------------------------------------
34
35export interface ClipPathEditorPanelProps {
36 value: ClipPathString | (string & {})
37 onChange: (value: ClipPathString) => void
38 /**
39 * Which CSS property the live preview targets. Both `clip-path` and
40 * `shape-outside` share the identical basic-shape grammar, so this does NOT
41 * change validation or narrow the `onChange` output — it only drives the
42 * preview render target + labels. Defaults to `"clip-path"`.
43 */
44 mode?: ClipMode
45 className?: string
46 "aria-label"?: string
47}
48
49export interface ClipPathEditorProps extends ClipPathEditorPanelProps {}
50
51// ---------------------------------------------------------------------------
52// ClipPathEditor — popover-wrapped
53// ---------------------------------------------------------------------------
54
55export function ClipPathEditor(props: ClipPathEditorProps) {
56 const {
57 value,
58 className,
59 "aria-label": ariaLabel = "Edit a clip-path",
60 } = props
61 const state = parseClipPath(String(value))
62 const label =
63 state === null
64 ? "invalid"
65 : state.shape === null
66 ? (state.box ?? "none")
67 : state.shape.shape
68
69 return (
70 <Popover>
71 <PopoverTrigger asChild>
72 <Button
73 variant="outline"
74 className={cn("h-9 gap-2 px-3 font-mono", className)}
75 aria-label={ariaLabel}
76 >
77 <span aria-hidden="true" className="text-foreground/60">
78 ⬡
79 </span>
80// … truncated

What it pulls in

Other registry items

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

Files it writes

  • src/components/ui/clip-path-editor/index.ts
  • src/components/ui/clip-path-editor/clip-path-editor.tsx
  • src/components/ui/clip-path-editor/clip-path-editor.types.ts
  • src/components/ui/clip-path-editor/clip-path-editor.helpers.ts
  • src/components/ui/clip-path-editor/clip-path-editor.constants.ts
  • src/components/ui/clip-path-editor/clip-path-editor.hooks.ts
  • src/components/ui/clip-path-editor/controls/circle.tsx
  • src/components/ui/clip-path-editor/controls/ellipse.tsx
  • src/components/ui/clip-path-editor/controls/inset.tsx
  • src/components/ui/clip-path-editor/controls/length-pct.tsx
  • src/components/ui/clip-path-editor/controls/polygon.tsx
  • src/components/ui/clip-path-editor/controls/position.tsx
  • src/components/ui/clip-path-editor/controls/radius.tsx
  • src/components/ui/clip-path-editor/controls/shape-controls.tsx
  • src/components/ui/clip-path-editor/preview/circle-scrubs.tsx
  • src/components/ui/clip-path-editor/preview/clip-path-preview.tsx
  • src/components/ui/clip-path-editor/primitives/geometry-box-select.tsx
  • src/components/ui/clip-path-editor/primitives/labeled-field.tsx
  • src/components/ui/clip-path-editor/primitives/live-string.tsx
  • src/components/ui/clip-path-editor/primitives/shape-select.tsx

Facts

Registry
ridiculous
Type
registry:ui
Access
Free
Files written
20
Licence
MIT
In the index
at or before 2026-08-02
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
Color Functioncolor-functionridiculousComponentsFreeno deps · 10 files
Color Pickercolor-pickerridiculousComponentsFreeno deps · 11 files
Easing Pickereasing-pickerridiculousComponentsFreeno deps · 17 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