Skip to content

Switch

An on/off toggle for settings that apply immediately. A native checkbox with role="switch".

Settings

  • Airplane mode
    Disable all wireless connections
  • Notifications
    Push and email

Sizes and colours

Installation

Everything ships in one stylesheet. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">

Prefer to own the files? /r/switch.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-switchOn an <input type="checkbox" role="switch">.
mn-switch-sm · mn-switch-lgSizes.

Accessibility

  • Add role="switch" so it is announced as on/off rather than checked/unchecked.
  • Use a switch for immediate effect; use a checkbox inside forms that are submitted.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page