drawer-dialog.tsx — ui Source File
Architecture documentation for drawer-dialog.tsx, a tsx file in the ui codebase. 8 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27["drawer-dialog.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 4b1d2128_46d9_46f0_b915_b6e1925b7876["button"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> 4b1d2128_46d9_46f0_b915_b6e1925b7876 cd433a12_a20e_c2ab_21fc_4d4945c6d923["dialog"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> cd433a12_a20e_c2ab_21fc_4d4945c6d923 6e0d3850_8923_6c1a_58c9_baba0ca937aa["drawer"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> 6e0d3850_8923_6c1a_58c9_baba0ca937aa 9af00736_7b63_3c3c_87d0_68c5200c5d80["input"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> 9af00736_7b63_3c3c_87d0_68c5200c5d80 2a43f855_1408_526d_d4d2_31c7a87506c6["label"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> 2a43f855_1408_526d_d4d2_31c7a87506c6 79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81 5b9fe790_07fa_d673_2d62_394a21141145["use-media-query"] 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 --> 5b9fe790_07fa_d673_2d62_394a21141145 style 69e37eb1_61e5_41b7_c3e4_5cfaf0c8ae27 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { Button } from "@/examples/radix/ui/button"
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/examples/radix/ui/dialog"
import {
Drawer,
DrawerClose,
DrawerContent,
DrawerDescription,
DrawerFooter,
DrawerHeader,
DrawerTitle,
DrawerTrigger,
} from "@/examples/radix/ui/drawer"
import { Input } from "@/examples/radix/ui/input"
import { Label } from "@/examples/radix/ui/label"
import { cn } from "@/lib/utils"
import { useMediaQuery } from "@/hooks/use-media-query"
export 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>
)
}
function ProfileForm({ className }: React.ComponentProps<"form">) {
return (
<form className={cn("grid items-start gap-6", className)}>
<div className="grid gap-3">
<Label htmlFor="email">Email</Label>
<Input type="email" id="email" defaultValue="shadcn@example.com" />
</div>
<div className="grid gap-3">
<Label htmlFor="username">Username</Label>
<Input id="username" defaultValue="@shadcn" />
</div>
<Button type="submit">Save changes</Button>
</form>
)
}
Domain
Subdomains
Functions
Dependencies
- button
- dialog
- drawer
- input
- label
- react
- use-media-query
- utils
Source
Frequently Asked Questions
What does drawer-dialog.tsx do?
drawer-dialog.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, ContentSourcing subdomain.
What functions are defined in drawer-dialog.tsx?
drawer-dialog.tsx defines 2 function(s): DrawerDialogDemo, ProfileForm.
What does drawer-dialog.tsx depend on?
drawer-dialog.tsx imports 8 module(s): button, dialog, drawer, input, label, react, use-media-query, utils.
Where is drawer-dialog.tsx in the architecture?
drawer-dialog.tsx is located at apps/v4/examples/radix/drawer-dialog.tsx (domain: DocumentationAtlas, subdomain: ContentSourcing, directory: apps/v4/examples/radix).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free