Alert Dialog
A modal dialog that interrupts the user with important content and expects a response.
Usage
- Alert Dialog takes multiple
propswhich can be passed in asdestructure objectas show in above example. classNameprop is used to style the trigger of Alert Dialog component.
Interface for AlertDialogProps
import { buttonVariants } from "dubsui";
import { type VariantProps } from "class-variance-authority";
interface AlertDialogProps {
className?: string;
cancelVariant?: VariantProps<typeof buttonVariants>["variant"]; // "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined
actionVariant?: VariantProps<typeof buttonVariants>["variant"]; // "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined
buttonSize?: VariantProps<typeof buttonVariants>["size"]; // "default" | "sm" | "lg" | "icon" | null | undefined
dialogTitle?: string;
dialogDescription?: string;
cancelText?: string;
actionText?: string;
onCancle?: () => void;
onAction?: () => void;
trigger?: React.ReactNode;
}- You can find more information about
cancleVariant,actionVariantandbuttonSizein Button component asbuttonVariants.
Customizable Design
More granular components provide you with more control over the design of the Alert Dialog component. You can customize the design of the Alert Dialog component by using the following sub-components:
- Style of every sub-component can be customized using the
classNameprop. - Pass in a
CSS class, useTailwind CSSutility classes or useinline-styleto style the sub-component.