drawer
gmhlab/drawerFreeComponent
gmhlab publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/gmhlab/monorepo/main/packages/ui/public/r/drawer.jsonSource
1import * as React from "react"2import { Drawer as DrawerPrimitive } from "vaul"34import { cn } from "@/lib/utils"56function Drawer({7 ...props8}: React.ComponentProps<typeof DrawerPrimitive.Root>) {9 return <DrawerPrimitive.Root data-slot="drawer" {...props} />10}1112function DrawerTrigger({13 ...props14}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {15 return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />16}1718function DrawerPortal({19 ...props20}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {21 return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />22}2324function DrawerClose({25 ...props26}: React.ComponentProps<typeof DrawerPrimitive.Close>) {27 return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />28}2930function DrawerOverlay({31 className,32 ...props33}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {34 return (35 <DrawerPrimitive.Overlay36 data-slot="drawer-overlay"37 className={cn(38 "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",39 className40 )}41 {...props}42 />43 )44}4546function DrawerContent({47 className,48 children,49 ...props50}: React.ComponentProps<typeof DrawerPrimitive.Content>) {51 return (52 <DrawerPortal data-slot="drawer-portal">53 <DrawerOverlay />54 <DrawerPrimitive.Content55 data-slot="drawer-content"56 className={cn(57 "group/drawer-content bg-background fixed z-50 flex h-auto flex-col",58 "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",59 "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",60 "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",61// … truncated
What it pulls in
npm packages
Files it writes
More from gmhlab
All 64 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | gmhlab | Components | Free | 2 deps | |
| alertalert | gmhlab | Components | Free | 1 dep | |
| alert-dialogalert-dialog | gmhlab | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | gmhlab | Components | Free | 1 dep | |
| avataravatar | gmhlab | Components | Free | 1 dep | |
| badgebadge | gmhlab | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | gmhlab | Components | Free | 2 deps | |
| buttonbutton | gmhlab | Components | Free | 2 deps |
