Dialog
VisionOS-style dialog component
VisionOS-style Dialog Component
This component provides a VisionOS-style dialog that creates a receding effect on the background content when a dialog is opened. The background content scales down and dims, while the dialog appears with a glass effect.
Features
- VisionOS-style dialog with glass effect
- Background content scales down and dims when dialog opens
- Smooth animations for opening and closing
- Fully accessible using Radix UI primitives
- Customizable glass thickness
- Optional close button
Usage
Basic Example
Controlled Dialog
Components
VisionDialog
The root component that provides context for the dialog state.
Props:
open?: boolean
- Controlled open stateonOpenChange?: (open: boolean) => void
- Callback when open state changes- All other props from Radix UI Dialog.Root
WithVisionDialogEffect
Wrap your content with this component to apply the scale and dim effect when the dialog opens.
VisionDialogTrigger
A button that opens the dialog when clicked.
VisionDialogContent
The content of the dialog.
Props:
thickness?: GlassThickness
- The thickness of the glass effect (default: "normal")showCloseButton?: boolean
- Whether to show the close button (default: true)- All other props from Radix UI Dialog.Content
VisionDialogHeader
A container for the dialog header.
VisionDialogFooter
A container for the dialog footer, typically containing action buttons.
VisionDialogTitle
The title of the dialog.
VisionDialogDescription
A description for the dialog.
VisionDialogClose
A button that closes the dialog when clicked.
Edit on GitHub
Last updated on