Get Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Confirm Dialog
- Container
- Context Menu
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input Number
- Input OTP
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tailwind Indicator
- Textarea
- Toggle
- Toggle Group
- Tooltip
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogClose,
DialogContent,Installation
pnpm slabui add dialog
Usage
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"<Dialog>
<DialogTrigger>Open</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Are you absolutely sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>Composition
Use the following composition to build a Dialog:
Dialog
โโโ DialogTrigger
โโโ DialogContent
โโโ DialogHeader
โ โโโ DialogTitle
โ โโโ DialogDescription
โโโ DialogFooterCustom Close Button
Replace the default close control with your own button.
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogClose,
DialogContent,No Close Button
Use showCloseButton={false} to hide the close button.
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogContent,
DialogDescription,Sticky Footer
Keep actions visible while the content scrolls.
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogClose,
DialogContent,Scrollable Content
Long content can scroll while the header stays in view.
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogContent,
DialogDescription,API Reference
See the Base UI documentation for more information.