Skip to content

SCheckbox <s-checkbox>

ts
import { SCheckbox } from 'polaris-vue-elements'

Example

Checked: false

vue
<script setup>
import { ref } from 'vue'
import { SCheckbox } from 'polaris-vue-elements'

const value = ref(false)
</script>

<template>
  <SCheckbox label="Send me marketing emails" v-model="value" />
  <p>Checked: {{ value }}</p>
</template>

v-model

v-model on <SCheckbox> binds to the checked property and listens for the change DOM event.

template
<SCheckbox v-model="value" />

is equivalent to:

template
<SCheckbox :checked="value" @change="value = $event.target.checked" />

Props

PropTypeDescription
accessibilityLabelstringA label used for users using assistive technologies like screen readers. When set, any children or label supplied will not be announced. This can also be used to display a control without a visual label, while still providing context to users using screen readers.
checkedbooleanWhether the control is active.
defaultCheckedbooleanWhether the control is active by default.
defaultIndeterminateboolean
detailsanyAdditional text to provide context or guidance for the field. This text is displayed along with the field and its label to offer more information or instructions to the user. This will also be exposed to screen reader users.
disabledbooleanDisables the control, disallowing any interaction.
erroranyIndicate an error to the user. The field will be given a specific stylistic treatment to communicate problems that have to be resolved immediately.
indeterminateboolean
labelanyVisual content to use as the control label.
labelAccessibilityVisibility"visible" | "exclusive"
namestringAn identifier for the control that is unique within the nearest containing Form component.
requiredbooleanWhether the field needs a value. This requirement adds semantic value to the field, but it will not cause an error to appear automatically. If you want to present an error when this field is empty, you can do so with the error property.
valuestring

Events

EventType
blurCustomEvent
changeCustomEvent
inputCustomEvent

Listen for these with @blur-style listeners on <SCheckbox>.

Slots

SlotDescription
details
error