BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/cult/ui/family-drawer

family-drawer

cult-ui/family-drawer
UnverifiedComponent

A multi-view drawer component with smooth animations, view navigation, and customizable content views

Install it

npx shadcn@latest add https://raw.githubusercontent.com/nolly-studio/cult-ui/HEAD/apps/www/family-drawer.json

Source

registry/default/ui/family-drawer.tsxraw.githubusercontent.com/nolly-studio/cult-ui/HEAD/apps/www/family-drawer.json · first 6 KB
1"use client"
2
3import {
4 createContext,
5 useContext,
6 useMemo,
7 useRef,
8 useState,
9 type ReactNode,
10} from "react"
11import { Slot } from "@radix-ui/react-slot"
12import clsx from "clsx"
13import { AnimatePresence, motion } from "motion/react"
14import useMeasure from "react-use-measure"
15import { Drawer } from "vaul"
16
17// ============================================================================
18// Types
19// ============================================================================
20
21type ViewComponent = React.ComponentType<Record<string, unknown>>
22
23interface ViewsRegistry {
24 [viewName: string]: ViewComponent
25}
26
27// ============================================================================
28// Context
29// ============================================================================
30
31interface FamilyDrawerContextValue {
32 isOpen: boolean
33 view: string
34 setView: (view: string) => void
35 opacityDuration: number
36 elementRef: ReturnType<typeof useMeasure>[0]
37 bounds: ReturnType<typeof useMeasure>[1]
38 views: ViewsRegistry | undefined
39}
40
41const FamilyDrawerContext = createContext<FamilyDrawerContextValue | undefined>(
42 undefined
43)
44
45function useFamilyDrawer() {
46 const context = useContext(FamilyDrawerContext)
47 if (!context) {
48 throw new Error(
49 "FamilyDrawer components must be used within FamilyDrawerRoot"
50 )
51 }
52 return context
53}
54
55// ============================================================================
56// Root Component
57// ============================================================================
58
59interface FamilyDrawerRootProps {
60 children: ReactNode
61 open?: boolean
62 defaultOpen?: boolean
63 onOpenChange?: (open: boolean) => void
64 defaultView?: string
65 onViewChange?: (view: string) => void
66 views?: ViewsRegistry
67}
68
69function FamilyDrawerRoot({
70 children,
71 open: controlledOpen,
72 defaultOpen = false,
73 onOpenChange,
74 defaultView = "default",
75 onViewChange,
76 views: customViews,
77}: FamilyDrawerRootProps) {
78 const [internalOpen, setInternalOpen] = useState(defaultOpen)
79 const [view, setView] = useState(defaultView)
80 const [elementRef, bounds] = useMeasure()
81 const previousHeightRef = useRef<number>(0)
82
83 const isOpen = controlledOpen !== undefined ? controlledOpen : internalOpen
84 const setIsOpen = onOpenChange || setInternalOpen
85
86 const opacityDuration = useMemo(() => {
87 const currentHeight = bounds.height
88 const previousHeight = previousHeightRef.current
89
90 const MIN_DURATION = 0.15
91 const MAX_DURATION = 0.27
92
93// … truncated

What it pulls in

npm packages

  • motion
  • react-use-measure
  • vaul
  • @radix-ui/react-slot

Files it writes

  • registry/default/ui/family-drawer.tsx

Facts

Registry
cult/ui
Type
registry:ui
Access
Unverified
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-11
Last confirmed
today

Go to the source

www.cult-ui.com nolly-studio/cult-ui on GitHub Raw registry item This item as JSON

More from cult/ui

All 157 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ai-instructionsai-instructionscult/uiComponentsUnverified2 deps
ai-instructions-demoai-instructions-democult/uiComponentsUnverifiedno deps
animated-numberanimated-numbercult/uiComponentsUnverified1 dep
animated-number-demoanimated-number-democult/uiComponentsUnverifiedno deps
bg-animate-buttonbg-animate-buttoncult/uiComponentsUnverifiedno deps
bg-animate-button-demobg-animate-button-democult/uiComponentsUnverifiedno deps
bg-animated-fractal-dot-gridbg-animated-fractal-dot-gridcult/uiComponentsUnverified1 dep
bg-animated-fractal-dot-grid-demobg-animated-fractal-dot-grid-democult/uiComponentsUnverifiedno deps

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