Components / switch

switch

Toggle switch built on <input type=checkbox>.

status: stable js: none support: baseline

Preview

Markup

<input type="checkbox" class="switch" checked>

Install

Import the component CSS (depends on base/tokens.css):

@import "@russfranky/shadcss/src/components/switch.css";

…or copy it into your repo with the CLI:

npx @russfranky/shadcss-cli add switch

Accessibility

Classes

.switch .switch-sm .switch-lg

Dependencies

base/tokens