16 lines
446 B
Plaintext
16 lines
446 B
Plaintext
// Toggle switch (an accessible checkbox styled as a switch).
|
|
component Switch {
|
|
props {
|
|
name = ""
|
|
label = ""
|
|
class = ""
|
|
}
|
|
view {
|
|
<label class="wire-switch {class}">
|
|
<input type="checkbox" name="{name}" class="wire-switch__input" role="switch">
|
|
<span class="wire-switch__track"><span class="wire-switch__thumb"></span></span>
|
|
<span class="wire-switch__label"><slot>{label}</slot></span>
|
|
</label>
|
|
}
|
|
}
|