Confirm
<zn-confirm> | ZnConfirm
Short summary of the component’s intended use.
<zn-button id="action-trigger">Trigger Confirm Content</zn-button> <zn-confirm trigger="action-trigger" type="error" caption="Do Something" content="Are you sure you want to do that?"> </zn-confirm> <zn-button id="action-trigger-2">Trigger Confirm Content with Form</zn-button> <zn-confirm trigger="action-trigger-2" type="error" caption="Do Something" content="Are you sure you want to do that?"> <form class="form-spacing"> <zn-input label="Name" required></zn-input> <zn-input label="Email" type="email" required></zn-input> </form> </zn-confirm>
Examples
Announcement Confirmations
<zn-button id="action-trigger">Trigger Confirm Content</zn-button> <zn-confirm trigger="action-trigger" variant="announcement" type="warning" caption="Changing the status of this item" content="By changing the status of this item, you will be affecting the status of all related items."> <form class="form-spacing"> <zn-input label="Name" required></zn-input> <zn-input label="Email" type="email" required></zn-input> </form> </zn-confirm>
Second Example
TODO
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/confirm/confirm.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/confirm/confirm.js';
To import this component using a bundler:
import '@kubex/zinc/dist/components/confirm/confirm.js';
Slots
Name | Description |
---|---|
(default) | The default slot. |
example
|
An example slot. |
Learn more about using slots.
Properties
Name | Description | Reflects | Type | Default |
---|---|---|---|---|
variant
|
The dialog’s theme variant. |
|
'default' | 'warning' | 'announcement'
|
'default'
|
size
|
The dialog’s size. |
|
'small' | 'medium' | 'large'
|
'medium'
|
type
|
The dialogs type, which will determine the icon and color. |
'warning' | 'error' | 'success' | 'info'
|
'warning'
|
|
open
|
Indicated whether of not the dialog is open. You can toggle this attribute to show and hide the
dialog, or you can use the show() and hide() methods and this attribute
will reflect the dialog’s state.
|
|
boolean
|
false
|
trigger
|
The dialog’s trigger element. This is used to open the dialog when clicked. If you do not provide a
trigger, you will need to manually open the dialog using the show() method.
|
|
string
|
- |
announcement
|
The Dialogs announcement text. |
string
|
''
|
|
footerText
footer-text
|
The Dialogs footer text. |
string
|
''
|
|
updateComplete |
A read-only promise that resolves when the component has finished updating. |
Learn more about attributes and properties.
Events
Name | React Event | Description | Event Detail |
---|---|---|---|
zn-event-name |
|
Emitted as an example. | - |
Learn more about events.
Custom Properties
Name | Description | Default |
---|---|---|
--example |
An example CSS custom property. |
Learn more about customizing CSS custom properties.
Parts
Name | Description |
---|---|
base |
The component’s base wrapper. |
Learn more about customizing CSS parts.
Dependencies
This component automatically imports the following dependencies.
<zn-example>