Files
WRNexusJS/packages/ui/components/switch.wrn
T
2026-07-12 15:55:18 +05:30

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>
}
}