BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/basecn/drawer

Drawer

basecn/drawer
FreeComponent

A drawer component for React.

Live preview

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

Install it

npx shadcn@latest add https://basecn.dev/r/drawer.json

Source

src/registry/components/ui/drawer.tsxbasecn.dev/r/drawer.json
1"use client";
2
3import * as React from "react";
4import { Drawer as DrawerPrimitive } from "vaul-base";
5
6import { cn } from "@/lib/utils";
7
8function Drawer({
9 ...props
10}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
11 return <DrawerPrimitive.Root data-slot="drawer" {...props} />;
12}
13
14function DrawerTrigger({
15 ...props
16}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
17 return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
18}
19
20function DrawerPortal({
21 ...props
22}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
23 return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
24}
25
26function DrawerClose({
27 ...props
28}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
29 return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
30}
31
32function DrawerOverlay({
33 className,
34 ...props
35}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
36 return (
37 <DrawerPrimitive.Overlay
38 data-slot="drawer-overlay"
39 className={cn(
40 "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
41 className
42 )}
43 {...props}
44 />
45 );
46}
47
48function DrawerContent({
49 className,
50 children,
51 ...props
52}: React.ComponentProps<typeof DrawerPrimitive.Content>) {
53 return (
54 <DrawerPortal data-slot="drawer-portal">
55 <DrawerOverlay />
56 <DrawerPrimitive.Content
57 data-slot="drawer-content"
58 className={cn(
59 "group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
60 "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
61 "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
62 "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
63// … truncated

What it pulls in

npm packages

  • vaul-base

Files it writes

  • src/registry/components/ui/drawer.tsx

Facts

Registry
basecn
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on basecn basecn.dev akash3444/basecn on GitHub Raw registry item This item as JSON

More from basecn

All 56 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionbasecnComponentsFree2 deps
AlertalertbasecnComponentsFree1 dep
Alert Dialogalert-dialogbasecnComponentsFree1 dep
Aspect Ratioaspect-ratiobasecnComponentsFreeno deps
AutocompleteautocompletebasecnComponentsFree2 deps
AvataravatarbasecnComponentsFree1 dep
BadgebadgebasecnComponentsFree2 deps
BreadcrumbbreadcrumbbasecnComponentsFree2 deps
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