Drawer
uiable/drawerFreeComponent
Drawer component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/drawer.jsonSource
1"use client";23import { ComponentProps } from "react";45import { Drawer as DrawerPrimitive } from "vaul";67import { cn } from "@/lib/utils";89function Drawer({10 ...props11}: ComponentProps<typeof DrawerPrimitive.Root>) {12 return <DrawerPrimitive.Root data-slot="drawer" {...props} />;13}1415function DrawerTrigger({16 ...props17}: ComponentProps<typeof DrawerPrimitive.Trigger>) {18 return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;19}2021function DrawerPortal({22 ...props23}: ComponentProps<typeof DrawerPrimitive.Portal>) {24 return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;25}2627function DrawerClose({28 ...props29}: ComponentProps<typeof DrawerPrimitive.Close>) {30 return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;31}3233function DrawerOverlay({34 className,35 ...props36}: ComponentProps<typeof DrawerPrimitive.Overlay>) {37 return (38 <DrawerPrimitive.Overlay39 data-slot="drawer-overlay"40 className={cn(41 "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 z-50 bg-gray-900/20 supports-backdrop-filter:backdrop-blur-xs",42 className43 )}44 {...props}45 />46 );47}4849function DrawerContent({50 className,51 children,52 ...props53}: ComponentProps<typeof DrawerPrimitive.Content>) {54 return (55 <DrawerPortal data-slot="drawer-portal">56 <DrawerOverlay />57 <DrawerPrimitive.Content58 data-slot="drawer-content"59 className={cn(60// … truncated
What it pulls in
npm packages
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps |
