Components
Dialog
A modal window that traps focus and returns it when closed.
Ombelle · light
Dialog
Installation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add dialogAdds components/ui/dialog.tsx and installs react, @radix-ui/react-dialog, clsx, tailwind-merge, lucide-react with lifecycle scripts disabled. This is a client component.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import {
Dialog, DialogTrigger, DialogContent, DialogTitle, DialogDescription,
} from '@/components/ui/dialog'
export function Confirm() {
return (
<Dialog>
<DialogTrigger>Open dialog</DialogTrigger>
<DialogContent>
<DialogTitle>Publish project?</DialogTitle>
<DialogDescription>Everyone with the link can see it.</DialogDescription>
</DialogContent>
</Dialog>
)
}API and states
- API
- Dialog, DialogTrigger, DialogContent (size sm, default, lg or fullscreen), DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose
- Minimum states
- Open, closed, scroll, focus return
- Native basis
- Reviewed Radix dialog primitive
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.