drawer
yyc3-knowledge-base/drawerUnverifiedComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/YYC-Cube/YYC3-Knowledge-Base/main/YYC3-D/ui/apps/v4/drawer.jsonSource
1"use client"23import * as React from "react"4import { Drawer as DrawerPrimitive } from "vaul"56import { cn } from "@/lib/utils"78const Drawer = ({9 shouldScaleBackground = true,10 ...props11}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (12 <DrawerPrimitive.Root13 shouldScaleBackground={shouldScaleBackground}14 {...props}15 />16)17Drawer.displayName = "Drawer"1819const DrawerTrigger = DrawerPrimitive.Trigger2021const DrawerPortal = DrawerPrimitive.Portal2223const DrawerClose = DrawerPrimitive.Close2425const DrawerOverlay = React.forwardRef<26 React.ElementRef<typeof DrawerPrimitive.Overlay>,27 React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>28>(({ className, ...props }, ref) => (29 <DrawerPrimitive.Overlay30 ref={ref}31 className={cn("fixed inset-0 z-50 bg-black/80", className)}32 {...props}33 />34))35DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName3637const DrawerContent = React.forwardRef<38 React.ElementRef<typeof DrawerPrimitive.Content>,39 React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>40>(({ className, children, ...props }, ref) => (41 <DrawerPortal>42 <DrawerOverlay />43 <DrawerPrimitive.Content44 ref={ref}45 className={cn(46 "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",47 className48 )}49 {...props}50 >51 <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />52 {children}53 </DrawerPrimitive.Content>54 </DrawerPortal>55))56DrawerContent.displayName = "DrawerContent"5758const DrawerHeader = ({59 className,60 ...props61}: React.HTMLAttributes<HTMLDivElement>) => (62 <div63 className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}64 {...props}65 />66)67DrawerHeader.displayName = "DrawerHeader"6869const DrawerFooter = ({70 className,71 ...props72}: React.HTMLAttributes<HTMLDivElement>) => (73 <div74 className={cn("mt-auto flex flex-col gap-2 p-4", className)}75 {...props}76 />77)78DrawerFooter.displayName = "DrawerFooter"7980const DrawerTitle = React.forwardRef<81 React.ElementRef<typeof DrawerPrimitive.Title>,82 React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>83>(({ className, ...props }, ref) => (84 <DrawerPrimitive.Title85 ref={ref}86 className={cn(87 "text-lg font-semibold leading-none tracking-tight",88 className89 )}90 {...props}91 />92))93DrawerTitle.displayName = DrawerPrimitive.Title.displayName9495const DrawerDescription = React.forwardRef<96// … truncated
What it pulls in
npm packages
Files it writes
More from shadcn/ui
All 411 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Unverified | 1 dep | |
| alertalert | shadcn/ui | Components | Unverified | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Unverified | 1 dep | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Unverified | 1 dep | |
| avataravatar | shadcn/ui | Components | Unverified | 1 dep | |
| badgebadge | shadcn/ui | Components | Unverified | 1 dep | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Unverified | 1 dep | |
| buttonbutton | shadcn/ui | Components | Unverified | 1 dep |
