Dialog
Dialog
Component demo
Interactive example
<ic-buttononclick="showDialog()">Launch dialog</ic-button><ic-dialogid="default-dialog"heading="Are you sure?"label="Coffee order"><ic-typography> You are about to add 'Americano' to your basket. Are you sure you want to continue?</ic-typography></ic-dialog>
Dialog details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
|
|---|---|---|
|
|
If set to |
|
|
|
If 'true', sets the 'primary' or rightmost button to the destructive variant. Stops initial focus being set on the 'primary' or rightmost default or slotted button. |
|
|
|
If set to |
|
|
|
If set to |
|
|
|
Sets the dismiss label tooltip and aria label. |
|
|
|
Sets the heading for the dialog. |
|
|
|
If |
|
|
|
If set to |
|
|
|
Sets the optional label for the dialog which appears above the heading. |
|
|
|
If |
|
|
|
Sets the maximum and minimum height and width for the dialog. |
|
|
|
Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component. |
|
|
If set to |
|
If 'true', sets the 'primary' or rightmost button to the destructive variant. Stops initial focus being set on the 'primary' or rightmost default or slotted button. |
|
If set to |
|
If set to |
|
Sets the dismiss label tooltip and aria label. |
|
Sets the heading for the dialog. |
|
If |
|
If set to |
|
Sets the optional label for the dialog which appears above the heading. |
|
If |
|
Sets the maximum and minimum height and width for the dialog. |
|
Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component. |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CSS Custom Properties
|
|
|
|---|---|
|
|
|
|
|
Events
All components also accept native events supported by the DOM, such as
onClick
and
onKeyDown
.
|
|
|
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Methods
|
|
|
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Variants
Sizes
Interactive example
<ic-buttononclick="showDialog()">Launch dialog</ic-button><ic-dialogid="size-dialog"heading="Are you sure?"label="Coffee order"><ic-typography> You are about to add 'Americano' to your basket. Are you sure you want to continue?</ic-typography></ic-dialog>