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
modelValuebooleanBound value (use with v-model)
labelstringSwitch label
defaultCheckedbooleanDefault checked (uncontrolled)
accessibilityLabelstringAccessible label
labelAccessibilityVisibility'visible' | 'exclusive'Label visibility for assistive tech
errorstringError message
detailsstringHelp text below the switch
requiredbooleanMarks the field as required
disabledbooleanDisables the switch
idstringElement ID
namestringForm 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.