Dialog
Dialog is part of the Disclosure and overlays group. Modal surface for focused tasks and confirmations.
Installation
Section titled “Installation”npx bambiui add dialog --framework reactnpx bambiui add dialog --framework solidnpx bambiui add dialog --framework sveltenpx bambiui add dialog --framework vueimport { Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose } from "@/components/ui/dialog";
export function Example() { return <Dialog />;}import { Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose } from "~/components/ui/dialog";
export function Example() { return <Dialog />;}<script lang="ts"> import { Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose } from "$lib/components/ui/dialog";</script>
<Dialog /><script setup lang="ts">import { Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose } from "@/components/ui/dialog";</script>
<template> <Dialog /></template>Preview
Section titled “Preview”Behavior
Section titled “Behavior”Use when the user must complete, cancel, or acknowledge a task before returning.
Generated output uses serializable data-* attributes for state and styling. Controlled components fire bambi:<event-name> events and expect application state to update externally; uncontrolled components manage local source state and still fire events.
Accessibility
Section titled “Accessibility”Use semantic labels, visible focus states, and keyboard interaction patterns appropriate for Dialog. Do not hide required instructions in transient UI. Verify focus movement and disabled states in the installed framework output.
Exports
Section titled “Exports”Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogCloseTokens
Section titled “Tokens”Customize tokens after installing and previewing the component. Relevant tokens include:
--bambi-background--bambi-foreground--bambi-border--bambi-radius-lg