nessra uinessra ui

A drawer component for mobile-friendly navigation and content.

Loading...
import { Button } from "@/components/ui/button"
import {
  Drawer,

Installation

pnpmnpmyarnbun
pnpm dlx shadcn@latest add https://nessra-ui.vercel.app/r/drawer.json

Usage

import {
  Drawer,
  DrawerClose,
  DrawerContent,
  DrawerDescription,
  DrawerFooter,
  DrawerHeader,
  DrawerTitle,
  DrawerTrigger,
} from "@/components/ui/drawer"
<Drawer>
  <DrawerTrigger>Open</DrawerTrigger>
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>Title</DrawerTitle>
      <DrawerDescription>Description</DrawerDescription>
    </DrawerHeader>
    <DrawerFooter>
      <Button>Submit</Button>
      <DrawerClose>Cancel</DrawerClose>
    </DrawerFooter>
  </DrawerContent>
</Drawer>

API Reference

Drawer

ComponentDescription
DrawerThe root component
DrawerTriggerThe button that opens it
DrawerContentThe drawer content container
DrawerHeaderHeader section
DrawerTitleThe drawer title
DrawerDescriptionDescription text
DrawerFooterFooter section for actions
DrawerCloseClose button component

Drawer Props

PropTypeDefaultDescription
openboolean-Controlled open state
onOpenChange(open: boolean) => void-Callback when open changes
shouldScaleBackgroundbooleantrueScale the background on open