Drawer
thegridcn/drawerFreeComponent
thegridcn publishes no description for this item.
See it running
Open the demo on thegridcn
thegridcn.com/r/drawerInstall it
npx shadcn@latest add https://thegridcn.com/r/drawer.jsonSource
1"use client"23import * as React from "react"4import { Drawer as DrawerPrimitive } from "vaul"56import { cn } from "@/lib/utils"78function Drawer({9 ...props10}: React.ComponentProps<typeof DrawerPrimitive.Root>) {11 return <DrawerPrimitive.Root data-slot="drawer" {...props} />12}1314function DrawerTrigger({15 ...props16}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {17 return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />18}1920function DrawerPortal({21 ...props22}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {23 return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />24}2526function DrawerClose({27 ...props28}: React.ComponentProps<typeof DrawerPrimitive.Close>) {29 return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />30}3132function DrawerOverlay({33 className,34 ...props35}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {36 return (37 <DrawerPrimitive.Overlay38 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 className42 )}43 {...props}44 />45 )46}4748function DrawerContent({49 className,50 children,51 ...props52}: React.ComponentProps<typeof DrawerPrimitive.Content>) {53 return (54 <DrawerPortal data-slot="drawer-portal">55 <DrawerOverlay />56 <DrawerPrimitive.Content57 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
Files it writes
More from thegridcn
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | thegridcn | Components | Free | 2 deps | |
| Agent Avataragent-avatar | thegridcn | Components | Free | no deps | |
| Alertalert | thegridcn | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | thegridcn | Components | Free | 1 dep | |
| Announcement Barannouncement-bar | thegridcn | Components | Free | no deps | |
| Anomaly Banneranomaly-banner | thegridcn | Components | Free | no deps | |
| Arrival Panelarrival-panel | thegridcn | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | thegridcn | Components | Free | 1 dep |
