Switch

Give textual form controls like `<input>`s and `<textarea>`s an upgrade with custom styles, sizing, focus states, and more.

Example

<div class="form">
  <div class="field">
    <div class="switcher">
      <label class="label" for="input1">
        Default checked radio
        <span class="toggle">
        <input class="switch" type="checkbox"/>
        <span class="span">
          <svg fill="currentColor" viewBox="0 0 12 12" class="icon">
            <path d="M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2" stroke="currentColor" stroke-width="2"
                  stroke-linecap="round" stroke-linejoin="round"></path>
          </svg>
          <svg fill="currentColor" viewBox="0 0 12 12" class="icon">
            <path
              d="M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"></path>
          </svg>
        </span>
      </span>
      </label>
    </div>
  </div>
</div>
@use '~/styles/app.scss' as app;

$form: app.get-theme(app.$theme, 'components.form');

@include app.generate-component(
  $form,
  'form',
  app.$config,
  app.$theme
);