BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/optics/drawer

Drawer

optics/drawer
FreeComponent

A drawer component built with Vaul.

See it running

Open the demo on optics

optics.agusmayol.com.ar/components/drawer
Open
This registry sends X-Frame-Options, so its page cannot be embedded here. The link is the same page the frame would have shown.

Install it

npx shadcn@latest add https://optics.agusmayol.com.ar/r/drawer.json

Source

registry/optics/drawer.jsxoptics.agusmayol.com.ar/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({ ...props } = {}) {
9 return <DrawerPrimitive.Root data-slot="drawer" {...props} />;
10}
11
12function DrawerTrigger({ ...props } = {}) {
13 return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
14}
15
16function DrawerPortal({ ...props } = {}) {
17 return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
18}
19
20function DrawerClose({ ...props } = {}) {
21 return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
22}
23
24function DrawerOverlay({ className = "", ...props }) {
25 return (
26 <DrawerPrimitive.Overlay
27 data-slot="drawer-overlay"
28 className={cn(
29 "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",
30 className,
31 )}
32 {...props}
33 />
34 );
35}
36
37function DrawerHandle({ className = "", ...props }) {
38 return (
39 <DrawerPrimitive.Handle
40 data-slot="drawer-handle"
41 className={cn(
42 "mx-auto mt-4 h-1.5 w-[100px] rounded-full bg-muted",
43 className,
44 )}
45 {...props}
46 />
47 );
48}
49
50function DrawerContent({ className = "", children = null, ...props }) {
51 return (
52 <DrawerPortal data-slot="drawer-portal">
53 <DrawerOverlay />
54 <DrawerPrimitive.Content
55 data-slot="drawer-content"
56 className={cn(
57 "before:bg-background flex h-auto flex-col bg-transparent p-2 text-xs/relaxed before:absolute before:inset-2 before:-z-10 before:rounded-xl 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=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 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=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=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm group/drawer-content fixed z-50",
58 className,
59 )}
60 {...props}
61 >
62 <DrawerHandle className="group-data-[vaul-drawer-direction=bottom]/drawer-content:block hidden shrink-0" />
63 {children}
64 </DrawerPrimitive.Content>
65// … truncated

What it pulls in

npm packages

  • vaul-base
  • clsx
  • tailwind-merge

Other registry items

  • https://optics.agusmayol.com.ar/r/utils.json

Files it writes

  • registry/optics/drawer.jsx

Facts

Registry
optics
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on optics optics.agusmayol.com.ar AgusMayol/optics on GitHub Raw registry item This item as JSON

More from optics

All 79 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionopticsComponentsFree5 deps
AlertalertopticsComponentsFree4 deps
Alert Dialogalert-dialogopticsComponentsFree4 deps
Aspect Ratioaspect-ratioopticsComponentsFree2 deps
Auto Heightauto-heightopticsComponentsFree3 deps
AvataravataropticsComponentsFree3 deps
BadgebadgeopticsComponentsFree4 deps
BreadcrumbbreadcrumbopticsComponentsFree4 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