Components
Loading preview...
A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.
npx shadcn@latest add https://21st.dev/r/shadcn/dialogimport { Button } from "@/components/ui/button";
import {
Dialog,
DialogClose,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
function Basic() {
return (
<Dialog>
<DialogTrigger asChild>
<Button variant="outline">Add Task</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Add Task</DialogTitle>
<DialogDescription>
New tasks are added to the default category.
</DialogDescription>
</DialogHeader>
<div className="grid gap-4 py-4">
<div className="grid gap-2">
<Label htmlFor="name">Task Name</Label>
<Input id="name" placeholder="Enter task name here" />
</div>
<div className="grid gap-2">
<Label htmlFor="assignee">Assignee</Label>
<Select>
<SelectTrigger>
<SelectValue id="assignee" placeholder="Select someone" />
</SelectTrigger>
<SelectContent>
<SelectItem value="1">Adam</SelectItem>
<SelectItem value="2">Ruth</SelectItem>
<SelectItem value="3">Taylor</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<DialogFooter>
<DialogClose asChild>
<Button type="button" variant="outline">
Cancel
</Button>
</DialogClose>
<Button type="submit">Add</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}
export { Basic }