20 lines
558 B
Plaintext
20 lines
558 B
Plaintext
component Button {
|
|
props {
|
|
label = "Button"
|
|
type = "button"
|
|
variant = "primary"
|
|
size = "md"
|
|
disabled = false
|
|
loading = false
|
|
icon = ""
|
|
className = ""
|
|
}
|
|
view {
|
|
<button type="{type}" disabled="{disabled || loading}" aria-busy="{loading}" class="wire-btn wire-btn--{variant} wire-btn--{size} {className}">
|
|
{#if loading}<span class="wire-spinner" aria-hidden="true"></span>{/if}
|
|
{#if icon && !loading}<span class="{icon} size-4" aria-hidden="true"></span>{/if}
|
|
<span>{label}</span>
|
|
</button>
|
|
}
|
|
}
|