SOption <s-option>
ts
import { SOption } from 'polaris-vue-elements'Example
<SOption> doesn't render on its own — it's an option within an <SSelect> (optionally grouped by <SOptionGroup>). Its value prop is what gets bound into the parent's v-model, and its default slot is the visible option label.
Value: (none)
vue
<script setup>
import { ref } from 'vue'
import { SSelect, SOption, SOptionGroup } from 'polaris-vue-elements'
const value = ref('')
</script>
<template>
<SSelect label="Shipping region" placeholder="Select a region" v-model="value">
<SOptionGroup label="North America">
<!-- Each SOption's `value` is what SSelect's v-model receives -->
<SOption value="us">United States</SOption>
<SOption value="ca">Canada</SOption>
</SOptionGroup>
<SOptionGroup label="Europe">
<SOption value="fr">France</SOption>
<SOption value="de">Germany</SOption>
</SOptionGroup>
</SSelect>
<p>Value: {{ value }}</p>
</template>Props
| Prop | Type | Description |
|---|---|---|
defaultSelected | boolean | Whether the control is active by default. |
disabled | boolean | Disables the control, disallowing any interaction. |
selected | boolean | Whether the control is active. |
value | string | The value used in form data when the control is checked. |
Slots
| Slot | Description |
|---|---|
default | The content to use as the label. |