BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ridiculous/box-shadow-editor

Box Shadow Editor

ridiculous/box-shadow-editor
FreeComponent

Ridiculously typed CSS box-shadow editor — a comma-separated list of shadow layers, each validated at compile time (2–4 lengths, at most one inset, an optional trailing color). Ships a live preview with a draggable light source and elevation scrubber.

Install it

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

Source

src/components/ui/box-shadow-editor/box-shadow-editor.tsxridiculous.turtlesocks.dev/r/box-shadow-editor.json
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 {
12 boxShadowLayerCount,
13 defaultLayer,
14 formatBoxShadow,
15 parseBoxShadow,
16} from "./box-shadow-editor.helpers"
17import type { BoxShadowString, ShadowLayer } from "./box-shadow-editor.types"
18import { BoxShadowPreview } from "./box-shadow-preview"
19import { ShadowLayerRow } from "./shadow-layer-row"
20
21// Re-export the extracted sub-components + their prop types so the public
22// entry surface (and existing deep imports) is unchanged by the file split.
23export type { BoxShadowPreviewProps } from "./box-shadow-preview"
24export { BoxShadowPreview } from "./box-shadow-preview"
25export type { ShadowLayerRowProps } from "./shadow-layer-row"
26export { ShadowLayerRow } from "./shadow-layer-row"
27export type { ShadowLengthEditorProps } from "./shadow-length-editor"
28export { ShadowLengthEditor } from "./shadow-length-editor"
29
30// ---------------------------------------------------------------------------
31// Shared props
32// ---------------------------------------------------------------------------
33
34export interface BoxShadowEditorPanelProps {
35 value: BoxShadowString | (string & {})
36 onChange: (value: BoxShadowString) => void
37 className?: string
38 "aria-label"?: string
39}
40
41export type BoxShadowEditorProps = BoxShadowEditorPanelProps
42
43// ---------------------------------------------------------------------------
44// BoxShadowEditor — popover-wrapped
45// ---------------------------------------------------------------------------
46
47export function BoxShadowEditor(props: BoxShadowEditorProps) {
48 const {
49 value,
50 className,
51 "aria-label": ariaLabel = "Edit a CSS box-shadow",
52 } = props
53 const count = boxShadowLayerCount(String(value))
54 const applied = String(value) === "none" ? undefined : String(value)
55
56 return (
57 <Popover>
58 <PopoverTrigger asChild>
59 <Button
60 variant="outline"
61 className={cn("h-9 gap-2 px-3 font-mono", className)}
62 aria-label={ariaLabel}
63 >
64 <span
65 aria-hidden="true"
66 className="inline-block h-4 w-4 rounded-sm bg-background"
67 style={{ boxShadow: applied }}
68 />
69 <span className="text-[10px] text-muted-foreground">
70 {count} {count === 1 ? "layer" : "layers"}
71 </span>
72// … truncated

What it pulls in

Other registry items

  • ridiculous-type-kit
  • color-picker
  • unit-input
  • button
  • popover
  • input
  • label
  • slider

Files it writes

  • src/components/ui/box-shadow-editor/index.ts
  • src/components/ui/box-shadow-editor/box-shadow-editor.tsx
  • src/components/ui/box-shadow-editor/box-shadow-editor.types.ts
  • src/components/ui/box-shadow-editor/box-shadow-editor.helpers.ts
  • src/components/ui/box-shadow-editor/box-shadow-preview.tsx
  • src/components/ui/box-shadow-editor/shadow-layer-row.tsx
  • src/components/ui/box-shadow-editor/shadow-length-editor.tsx

Facts

Registry
ridiculous
Type
registry:ui
Access
Free
Files written
7
Licence
MIT
In the index
at or before 2026-08-03
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
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
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