Drawer/drawer-right-

PreviousNext

A drawer/drawer-right- example

Docs
shadcnblocksblock

Preview

Loading preview…
code/example/drawer/drawer-right-1.tsx
"use client";

import { Button } from "@/components/ui/button";
import {
  Drawer,
  DrawerClose,
  DrawerContent,
  DrawerDescription,
  DrawerFooter,
  DrawerHeader,
  DrawerTitle,
  DrawerTrigger,
} from "@/components/ui/drawer";

export const title = "Simple Right Drawer";

const Example = () => (
  <Drawer direction="right">
    <DrawerTrigger asChild>
      <Button variant="outline">Open Right Drawer</Button>
    </DrawerTrigger>
    <DrawerContent>
      <DrawerHeader>
        <DrawerTitle>Drawer Title</DrawerTitle>
        <DrawerDescription>
          This drawer slides in from the right side.
        </DrawerDescription>
      </DrawerHeader>
      <div className="p-4">
        <p className="text-sm text-muted-foreground">
          Right-side drawers are great for supplementary content, settings, or
          detail views.
        </p>
      </div>
      <DrawerFooter>
        <Button>Confirm</Button>
        <DrawerClose asChild>
          <Button variant="outline">Cancel</Button>
        </DrawerClose>
      </DrawerFooter>
    </DrawerContent>
  </Drawer>
);

export default Example;

Installation

npx shadcn@latest add @shadcnblocks/drawer-drawer-right-1

Usage

import { DrawerDrawerRight1 } from "@/components/drawer-drawer-right-1"
<DrawerDrawerRight1 />