BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/solid-ui/drawer

Drawer

solid-ui/drawer
FreeComponent

A drawer component

Live preview

live · rendered by the registry
Rendered by solid-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.solid-ui.com/r/drawer.json

Source

src/registry/ui/drawer.tsxwww.solid-ui.com/r/drawer.json
1import type { Component, ComponentProps, JSX, ValidComponent } from "solid-js"
2import { splitProps } from "solid-js"
3
4import type {
5 ContentProps,
6 DescriptionProps,
7 DynamicProps,
8 LabelProps,
9 OverlayProps
10} from "@corvu/drawer"
11import DrawerPrimitive from "@corvu/drawer"
12
13import { cn } from "~/lib/utils"
14
15const Drawer = DrawerPrimitive
16
17const DrawerTrigger = DrawerPrimitive.Trigger
18
19const DrawerPortal = DrawerPrimitive.Portal
20
21const DrawerClose = DrawerPrimitive.Close
22
23type DrawerOverlayProps<T extends ValidComponent = "div"> = OverlayProps<T> & { class?: string }
24
25const DrawerOverlay = <T extends ValidComponent = "div">(
26 props: DynamicProps<T, DrawerOverlayProps<T>>
27) => {
28 const [, rest] = splitProps(props as DrawerOverlayProps, ["class"])
29 const drawerContext = DrawerPrimitive.useContext()
30 return (
31 <DrawerPrimitive.Overlay
32 class={cn(
33 "fixed inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300",
34 props.class
35 )}
36 style={{
37 "background-color": `rgb(0 0 0 / ${0.8 * drawerContext.openPercentage()})`
38 }}
39 {...rest}
40 />
41 )
42}
43
44type DrawerContentProps<T extends ValidComponent = "div"> = ContentProps<T> & {
45 class?: string
46 children?: JSX.Element
47}
48
49const DrawerContent = <T extends ValidComponent = "div">(
50 props: DynamicProps<T, DrawerContentProps<T>>
51) => {
52 const [, rest] = splitProps(props as DrawerContentProps, ["class", "children"])
53 return (
54 <DrawerPortal>
55 <DrawerOverlay />
56 <DrawerPrimitive.Content
57 class={cn(
58 "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background after:absolute after:inset-x-0 after:top-full after:h-1/2 after:bg-inherit data-[transitioning]:transition-transform data-[transitioning]:duration-300 md:select-none",
59 props.class
60 )}
61 {...rest}
62 >
63 <div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
64 {props.children}
65 </DrawerPrimitive.Content>
66 </DrawerPortal>
67 )
68}
69
70const DrawerHeader: Component<ComponentProps<"div">> = (props) => {
71 const [, rest] = splitProps(props, ["class"])
72 return <div class={cn("grid gap-1.5 p-4 text-center sm:text-left", props.class)} {...rest} />
73}
74
75const DrawerFooter: Component<ComponentProps<"div">> = (props) => {
76 const [, rest] = splitProps(props, ["class"])
77 return <div class={cn("t-auto flex flex-col gap-2 p-4", props.class)} {...rest} />
78}
79
80// … truncated

What it pulls in

npm packages

  • solid-js
  • @corvu/drawer

Files it writes

  • src/registry/ui/drawer.tsx

Facts

Registry
solid-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on solid-ui www.solid-ui.com stefan-karger/solid-ui on GitHub Raw registry item This item as JSON

More from solid-ui

All 55 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionsolid-uiComponentsFree2 deps
Alertalertsolid-uiComponentsFree3 deps
Alert Dialogalert-dialogsolid-uiComponentsFree2 deps
Aspect Ratioaspect-ratiosolid-uiComponentsFree1 dep
Avataravatarsolid-uiComponentsFree2 deps
Badgebadgesolid-uiComponentsFree2 deps
Badge Deltabadge-deltasolid-uiComponentsFree2 deps
Bar Listbar-listsolid-uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex