Forms

Switch

Toggle switch with v-model support. Wraps the Polaris <s-switch> web component.

Usage

<script setup>
const enabled = ref(false)
</script>

<template>
  <ShSwitch v-model="enabled" label="Enable notifications" />
</template>

Props

PropTypeDefaultDescription
modelValueboolean—Bound value (use with v-model)
labelstring—Switch label
defaultCheckedboolean—Default checked (uncontrolled)
accessibilityLabelstring—Accessible label
labelAccessibilityVisibility'visible' | 'exclusive'—Label visibility for assistive tech
errorstring—Error message
detailsstring—Help text below the switch
requiredboolean—Marks the field as required
disabledboolean—Disables the switch
idstring—Element ID
namestring—Form field name

Events

EventPayloadDescription
update:modelValuebooleanEmitted when toggled
changeEventNative change event
inputEventNative input event

Slots

SlotDescription
defaultAdditional content

Polaris Element

Renders as <s-switch>. See Polaris Switch docs.

© 2026 KiriminAja. Polaris and Shopify are trademarks of Shopify Inc.

KiriminAja not affiliated with Shopify.