Alert Dialog
A modal overlay component that requires an explicit user action or confirmation before closing.Â
Sizes
Use the alert-dialog-content-{size} class to control the component size.
Size values can include:smmdlgxl.
For more information on all available sizing utilities, visit TailwindÂ
Customizing
globals.css
:root {
--ex-alert-dialog-z-index: 50;
--ex-alert-dialog-overlay-z-index: 45;
--ex-alert-dialog-font-size-sm: var(--text-sm);
--ex-alert-dialog-font-size-md: var(--text-sm);
--ex-alert-dialog-font-size-lg: var(--text-sm);
--ex-alert-dialog-font-size-xl: var(--text-sm);
--ex-alert-dialog-radius-sm: var(--radius-sm);
--ex-alert-dialog-radius-md: var(--radius-sm);
--ex-alert-dialog-radius-lg: var(--radius-sm);
--ex-alert-dialog-radius-xl: var(--radius-sm);
--ex-alert-dialog-shadow-sm: var(--shadow-xl);
--ex-alert-dialog-shadow-md: var(--shadow-xl);
--ex-alert-dialog-shadow-lg: var(--shadow-xl);
--ex-alert-dialog-shadow-xl: var(--shadow-xl);
--ex-alert-dialog-w-sm: var(--container-sm);
--ex-alert-dialog-w-md: var(--container-md);
--ex-alert-dialog-w-lg: var(--container-lg);
--ex-alert-dialog-w-xl: var(--container-xl);
--ex-alert-dialog-section-gap-x-sm: calc(var(--spacing) * 2.5);
--ex-alert-dialog-section-gap-x-md: calc(var(--spacing) * 2.5);
--ex-alert-dialog-section-gap-x-lg: calc(var(--spacing) * 2.5);
--ex-alert-dialog-section-gap-y-sm: calc(var(--spacing) * 2);
--ex-alert-dialog-section-gap-y-md: calc(var(--spacing) * 2);
--ex-alert-dialog-section-gap-y-lg: calc(var(--spacing) * 2);
--ex-alert-dialog-section-px-sm: calc(var(--spacing) * 5);
--ex-alert-dialog-section-px-md: calc(var(--spacing) * 5);
--ex-alert-dialog-section-px-lg: calc(var(--spacing) * 5);
--ex-alert-dialog-section-px-xl: calc(var(--spacing) * 5);
--ex-alert-dialog-section-py-sm: calc(var(--spacing) * 5);
--ex-alert-dialog-section-py-md: calc(var(--spacing) * 5);
--ex-alert-dialog-section-py-lg: calc(var(--spacing) * 5);
--ex-alert-dialog-section-py-xl: calc(var(--spacing) * 5);
--ex-alert-dialog-title-font-size-sm: var(--text-base);
--ex-alert-dialog-title-font-size-md: var(--text-base);
--ex-alert-dialog-title-font-size-lg: var(--text-base);
--ex-alert-dialog-title-font-size-xl: var(--text-base);
--ex-alert-dialog-title-font-weight: var(--font-weight-semibold);
--ex-alert-dialog-description-font-size-sm: var(--text-sm);
--ex-alert-dialog-description-font-size-md: var(--text-sm);
--ex-alert-dialog-description-font-size-lg: var(--text-sm);
--ex-alert-dialog-description-font-size-xl: var(--text-sm);
--ex-alert-dialog-description-font-weight: var(--font-weight-normal);
--ex-alert-dialog-description-opacity: var(--ex-options-opacity-muted);
}API
Alert Dialog
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Alert Dialog Trigger
| Element | Selector |
|---|---|
AlertDialog.Trigger | .ex-alert-dialog-trigger |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Alert Dialog Content
| Element | Selector |
|---|---|
AlertDialog.Content | .ex-alert-dialog-content |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Alert Dialog Section
| Element | Selector |
|---|---|
AlertDialog.Section | .ex-alert-dialog-section |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Alert Dialog Overlay
| Element | Selector |
|---|---|
AlertDialog.Overlay | .ex-alert-dialog-overlay |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Alert Dialog Title
| Element | Selector |
|---|---|
AlertDialog.Title | .ex-alert-dialog-title |
| Prop | Type | Default |
|---|---|---|
as | ElementType | h4 |
asChild | boolean | false |
Alert Dialog Description
| Element | Selector |
|---|---|
AlertDialog.Description | .ex-alert-dialog-description |
| Prop | Type | Default |
|---|---|---|
as | ElementType | p |
asChild | boolean | false |
Alert Dialog Action
| Element | Selector |
|---|---|
AlertDialog.Action | .ex-alert-dialog-action |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Alert Dialog Cancel
| Element | Selector |
|---|---|
AlertDialog.Cancel | .ex-alert-dialog-cancel |
| Prop | Type | Default |
|---|---|---|
as | ElementType | div |
asChild | boolean | false |
Last updated on