Alert Dialog
Native Solid 2 fork. Original documentation and designs © WorkOS; historical posts retain their original context.
API Reference
This component inherits parts and props from the Alert Dialog primitive and is visually identical to Dialog, though with differing semantics and behavior.
Root
Contains all the parts of the dialog.
Trigger
Wraps the control that will open the dialog.
Content
Contains the content of the dialog. This component is based on the div element.
Title
An accessible title that is announced when the dialog is opened. This part is based on the Heading component with a pre-defined font size and leading trim on top.
Description
An optional accessible description that is announced when the dialog is opened. This part is based on the Text component with a pre-defined font size.
If you want to remove the description entirely, remove this part and pass aria-describedby={undefined} to Content.
Action
Wraps the control that will close the dialog. This should be distinguished visually from the Cancel control.
Cancel
Wraps the control that will close the dialog. This should be distinguished visually from the Action control.
Examples
Size
Use the size prop to control size of the dialog. It will affect the padding and border-radius of the Content.
Use it in conjunction with the width, minWidth and maxWidth props to control the width of the dialog.
With inset content
Use the Inset component to align content flush with the sides of the dialog.