Drawer/drawer-bottom-

PreviousNext

A drawer/drawer-bottom- example

Docs
shadcnblocksblock

Preview

Loading preview…
code/example/drawer/drawer-bottom-6.tsx
"use client";

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

export const title = "Bottom Drawer No Scale Background";

const Example = () => (
  <Drawer shouldScaleBackground={false}>
    <DrawerTrigger asChild>
      <Button variant="outline">Open (No Scaling)</Button>
    </DrawerTrigger>
    <DrawerContent>
      <DrawerHeader>
        <DrawerTitle>No Background Scaling</DrawerTitle>
        <DrawerDescription>
          The background doesn't scale when this drawer opens.
        </DrawerDescription>
      </DrawerHeader>
      <div className="p-4">
        <p className="text-sm text-muted-foreground">
          By default, drawers scale the background content. This drawer has{" "}
          <code className="rounded bg-muted px-1 py-0.5 text-xs">
            shouldScaleBackground=false
          </code>{" "}
          so the background remains static.
        </p>
      </div>
    </DrawerContent>
  </Drawer>
);

export default Example;

Installation

npx shadcn@latest add @shadcnblocks/drawer-drawer-bottom-6

Usage

import { DrawerDrawerBottom6 } from "@/components/drawer-drawer-bottom-6"
<DrawerDrawerBottom6 />