LoadingButton
Reusable loading button component.
Usage
Components are auto-discovered. Use the component directly in any .wrn view:
<LoadingButton
label="Continue"
loadingLabel="Loading…"
loading="false"
disabled="false"
type="button"
/>Legacy mount name: data-component="LoadingButton".
Props and attributes
| Prop | Type | Requirement | Default |
|---|---|---|---|
label | string | Optional | "Continue" |
loadingLabel | string | Optional | "Loading…" |
loading | boolean | Optional | false |
disabled | boolean | Optional | false |
type | string | Optional | "button" |
variant | string | Optional | "primary" |
class | string | Optional | "" |
Slots
This component does not declare a slot.
Events
This component does not declare a custom event.
Source contract
Installed source: components/LoadingButton.wrn
component LoadingButton {
props {
label = "Continue"
loadingLabel = "Loading…"
loading = false
disabled = false
type = "button"
variant = "primary"
class = ""
}
view {
<button type="{type}" disabled="{disabled || loading}" aria-disabled="{disabled || loading}" aria-busy="{loading}" class="wire-btn wire-btn--{variant} wire-loading-button {class}">
<span data-show="loading" class="wire-spinner wire-spinner--inline" aria-hidden="true">
</span>
<span>{loading ? loadingLabel : label}</span>
</button>
}
}