Pixelact Drawer
pixelact-ui/drawerFreeComponent
A pixel art styled drawer component built on top of vaul Drawer.
Live preview
live · rendered by the registry
Rendered by Pixelact UI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://pixelactui.com/r/drawer.jsonSource
1import { type VariantProps, cva } from "class-variance-authority";2import { Drawer as DrawerPrimitive } from "vaul";34import { cn } from "@/lib/utils";56import {7 Drawer as ShadcnDrawer,8 DrawerClose as ShadcnDrawerClose,9 DrawerDescription as ShadcnDrawerDescription,10 DrawerFooter as ShadcnDrawerFooter,11 DrawerHeader as ShadcnDrawerHeader,12 DrawerOverlay as ShadcnDrawerOverlay,13 DrawerPortal as ShadcnDrawerPortal,14 DrawerTitle as ShadcnDrawerTitle,15 DrawerTrigger as ShadcnDrawerTrigger,16} from "@/components/ui/drawer";1718import "@/components/ui/pixelact-ui/styles/styles.css";1920const Drawer = ShadcnDrawer;2122const DrawerPortal = ShadcnDrawerPortal;2324const DrawerOverlay = ShadcnDrawerOverlay;2526const DrawerClose = ShadcnDrawerClose;2728function DrawerTitle({29 className,30 children,31 ...props32}: React.ComponentProps<typeof DrawerPrimitive.Title>) {33 return (34 <ShadcnDrawerTitle className={cn(className)} {...props}>35 {children}36 </ShadcnDrawerTitle>37 );38}3940function DrawerDescription({41 className,42 children,43 ...props44}: React.ComponentProps<typeof DrawerPrimitive.Description>) {45 return (46 <ShadcnDrawerDescription className={cn(className)} {...props}>47 {children}48 </ShadcnDrawerDescription>49 );50}5152function DrawerTrigger({53 className,54 children,55 asChild,56 ...props57}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {58 return (59 <ShadcnDrawerTrigger60 className={cn(61 // Only apply default trigger styling when NOT using asChild62 !asChild &&63 "border-foreground dark:border-ring hover:bg-transparent active:bg-transparent focus:bg-transparent rounded-none border-4 focus:border-foreground hover:border-foreground dark:focus:border-ring bg-transparent data-[state=open]:bg-transparent data-[state=open]:border-foreground dark:data-[state=open]:border-ring",64 className65 )}66 asChild={asChild}67 {...props}68 >69 {children}70 </ShadcnDrawerTrigger>71 );72}7374export const drawerVariants = cva("", {75 variants: {76 font: {77 normal: "",78 pixel: "pixel-font",79 },80 },81 defaultVariants: {82 font: "pixel",83 },84});8586export type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Content> &87 VariantProps<typeof drawerVariants> & {88 side?: "right" | "bottom" | "left";89 };9091function DrawerContent({92 className,93 children,94 side = "bottom",95 ...props96}: DrawerProps) {97 return (98 <ShadcnDrawerPortal data-slot="drawer-portal">99// … truncated
What it pulls in
Other registry items
Files it writes
More from Pixelact UI
All 28 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Pixelact Accordionaccordion | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Alertalert | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Alert Dialogalert-dialog | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Avataravatar | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Badgebadge | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Breadcrumbbreadcrumb | Pixelact UI | Components | Free | no deps · 2 files | |
| Pixelact Buttonbutton | Pixelact UI | Components | Free | no deps · 3 files | |
| Pixelact Calendarcalendar | Pixelact UI | Components | Free | no deps · 2 files |
