Home / Function/ DrawerDialogDemo() — ui Function Reference

DrawerDialogDemo() — ui Function Reference

Architecture documentation for the DrawerDialogDemo() function in drawer-dialog.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  4218b0b2_b338_6ddb_d633_8f5f6eb36ee8["DrawerDialogDemo()"]
  a4637e2d_18e2_a7c9_49de_d83845d2bc95["drawer-dialog.tsx"]
  4218b0b2_b338_6ddb_d633_8f5f6eb36ee8 -->|defined in| a4637e2d_18e2_a7c9_49de_d83845d2bc95
  style 4218b0b2_b338_6ddb_d633_8f5f6eb36ee8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/registry/default/examples/drawer-dialog.tsx lines 27–71

export default function DrawerDialogDemo() {
  const [open, setOpen] = React.useState(false)
  const isDesktop = useMediaQuery("(min-width: 768px)")

  if (isDesktop) {
    return (
      <Dialog open={open} onOpenChange={setOpen}>
        <DialogTrigger asChild>
          <Button variant="outline">Edit Profile</Button>
        </DialogTrigger>
        <DialogContent className="sm:max-w-[425px]">
          <DialogHeader>
            <DialogTitle>Edit profile</DialogTitle>
            <DialogDescription>
              Make changes to your profile here. Click save when you're done.
            </DialogDescription>
          </DialogHeader>
          <ProfileForm />
        </DialogContent>
      </Dialog>
    )
  }

  return (
    <Drawer open={open} onOpenChange={setOpen}>
      <DrawerTrigger asChild>
        <Button variant="outline">Edit Profile</Button>
      </DrawerTrigger>
      <DrawerContent>
        <DrawerHeader className="text-left">
          <DrawerTitle>Edit profile</DrawerTitle>
          <DrawerDescription>
            Make changes to your profile here. Click save when you're done.
          </DrawerDescription>
        </DrawerHeader>
        <ProfileForm className="px-4" />
        <DrawerFooter className="pt-2">
          <DrawerClose asChild>
            <Button variant="outline">Cancel</Button>
          </DrawerClose>
        </DrawerFooter>
      </DrawerContent>
    </Drawer>
  )
}

Subdomains

Frequently Asked Questions

What does DrawerDialogDemo() do?
DrawerDialogDemo() is a function in the ui codebase, defined in deprecated/www/registry/default/examples/drawer-dialog.tsx.
Where is DrawerDialogDemo() defined?
DrawerDialogDemo() is defined in deprecated/www/registry/default/examples/drawer-dialog.tsx at line 27.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free