logo-icon
STW UI

Select

Select is used to pick a value from a list of options.

Usage

svelte
import { Select } from 'stwui';
// OR
import Select from 'stwui/select'; // for tree shaking

Basic

With Label

With Leading

With Error

You're doing it wrong!

Disabled

Multi-Select

With Mobile

Multi-Select With Mobile

Select Props

name string nanoid()
error string | undefined
placeholder string | undefined
value string | string[] | undefined
multiple boolean false
visible boolean false
optionLabel string label
optionValue string value
closeOnSelect boolean true
disabled boolean false
mobile boolean false
options SelectOption[]
on:change (e: Event) => void
on:input (e: Event) => void

Select Slots

label <Select.Label slot="label" />
leading <Select.Leading slot="leading" />
options <Select.Options slot="options" />

Select.Label Slots

default

Select.Leading Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Select.Options Slots

default

Select.Options.Option Props

option string

Select Class Identifiers

stwui-select
stwui-select-display
stwui-select-leading-wrapper
stwui-select-error-icon
stwui-select-drop-icon
stwui-select-error
stwui-select-label
stwui-select-options
stwui-select-option