BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ridiculous/anchor-position-editor

Anchor Position Editor

ridiculous/anchor-position-editor
FreeComponent

Ridiculously typed editor for CSS anchor positioning (mode prop). The strict tier enforces the position-area cross-axis rule — a keyword pair must sit on two different axes of the same coordinate system. The hero is a clickable 3×3 placement grid with a live snap preview.

Install it

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

Source

src/components/ui/anchor-position-editor/anchor-position-editor.tsxridiculous.turtlesocks.dev/r/anchor-position-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 { AnchorExprFields } from "./anchor-expr-fields"
12import {
13 formatAnchor,
14 formatPositionArea,
15 formatPositionTry,
16 keywordsToCell,
17 parseAnchor,
18 parsePositionArea,
19 parsePositionTry,
20} from "./anchor-position-editor.helpers"
21import type {
22 AnchorExpr,
23 AnchorPositionMode,
24 AnchorPositionString,
25 PositionAreaState,
26 TryFallback,
27} from "./anchor-position-editor.types"
28import { AnchorPreview } from "./anchor-preview"
29import { PositionAreaGrid, stateToKeywords } from "./position-area-grid"
30import { TryFallbackChain } from "./try-fallback-chain"
31
32// Re-export the public sub-components + their prop types so consumers (and the
33// barrel) can import them from `./anchor-position-editor`.
34export type { AnchorExprFieldsProps } from "./anchor-expr-fields"
35export { AnchorExprFields } from "./anchor-expr-fields"
36export type { AnchorPreviewProps } from "./anchor-preview"
37export { AnchorPreview } from "./anchor-preview"
38export type { MiniSelectProps } from "./mini-select"
39export { MiniSelect } from "./mini-select"
40export type { PositionAreaGridProps } from "./position-area-grid"
41export { PositionAreaGrid } from "./position-area-grid"
42export type { TryFallbackChainProps } from "./try-fallback-chain"
43export { TryFallbackChain } from "./try-fallback-chain"
44
45// ---------------------------------------------------------------------------
46// position-area state derivation (value string ⇄ grid state)
47// ---------------------------------------------------------------------------
48
49function deriveAreaState(value: string): PositionAreaState {
50 const { keywords } = parsePositionArea(value)
51 const system: PositionAreaState["system"] = keywords.some(
52 (k) => k.includes("block") || k.includes("inline"),
53 )
54 ? "logical"
55 : "physical"
56 const span =
57 keywords.length > 0 &&
58 keywords.every((k) => k.startsWith("span-")) &&
59 !keywords.includes("span-all")
60 // Strip span / logical down to the bare physical keyword for the cell lookup.
61 const bare = keywords.map((k) => {
62 let s = k.startsWith("span-") ? k.slice("span-".length) : k
63 s = s
64 .replace("block-start", "top")
65 .replace("block-end", "bottom")
66 .replace("inline-start", "left")
67 .replace("inline-end", "right")
68 return s
69 })
70// … truncated

What it pulls in

Other registry items

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

Files it writes

  • src/components/ui/anchor-position-editor/index.ts
  • src/components/ui/anchor-position-editor/anchor-position-editor.tsx
  • src/components/ui/anchor-position-editor/anchor-position-editor.types.ts
  • src/components/ui/anchor-position-editor/anchor-position-editor.helpers.ts
  • src/components/ui/anchor-position-editor/mini-select.tsx
  • src/components/ui/anchor-position-editor/position-area-grid.tsx
  • src/components/ui/anchor-position-editor/anchor-expr-fields.tsx
  • src/components/ui/anchor-position-editor/try-fallback-chain.tsx
  • src/components/ui/anchor-position-editor/anchor-preview.tsx

Facts

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