import { useState } from 'react';
import { Screen, View, Button, Text, Dialog } from '../index';
import { BlurView } from '@idealyst/blur';
import type { BackdropComponentProps } from '../Dialog/types';
/**
* Custom blur backdrop component for dialogs.
* Uses @idealyst/blur to create a frosted glass effect over the content.
*/
const BlurBackdrop = ({ isVisible }: BackdropComponentProps) => (
);
export const DialogExamples = () => {
const [basicOpen, setBasicOpen] = useState(false);
const [alertOpen, setAlertOpen] = useState(false);
const [confirmationOpen, setConfirmationOpen] = useState(false);
const [sizesOpen, setSizesOpen] = useState(null);
const [blurBackdropOpen, setBlurBackdropOpen] = useState(false);
return (
Dialog Examples
{/* Basic Dialog */}
Basic Dialog
{/* Dialog Variants */}
Dialog Variants
{/* Alert Dialog */}
{/* Confirmation Dialog */}
{/* Dialog Sizes */}
Dialog Sizes
{['sm', 'md', 'lg'].map((size) => (
))}
{sizesOpen && (
)}
{/* Custom Blur Backdrop */}
Custom Blur Backdrop
Use the BackdropComponent prop to create a custom blur backdrop using @idealyst/blur.
{/* Dialog Options */}
Dialog Options
• Close on backdrop click: Enabled by default, disabled for confirmation dialog above
• Close on escape key: Enabled by default (web only)
• Hardware back button: Handled automatically (native only)
• Focus management: Automatic focus trapping and restoration (web only)
• Custom backdrop: Use BackdropComponent prop for custom effects like blur
);
};