<sessions-select>
A dropdown of sessions-option children.
Preact & React
<Select>GroupFormsDrawn asSelectPreview
Drawn by the same renderers Sessions uses for your extension, from the DOM example beside it, without its event handlers.
When to use it
Each sessions-option names a value; its text is the label.
In Preact and React, import the component of the same name from @sessions/apps/preact or @sessions/apps/react. Attributes become camelCase props, a boolean attribute is a boolean prop, and an event is an on prop that receives the event’s detail.
Attributes
Attribute
labelThe field label.Prop
labelvalueThe selected value.Prop
valuehelp-textGuidance under the field.Prop
helpTexterrorA validation message.Prop
errordisabledbooleanNon-interactive.Prop
disabledEvents
changedetail: string — the new valueA different option was chosen.Prop
onChangeExample
import {Select, Option} from '@sessions/apps/preact';
<Select label="Service" value={service} onChange={(value) => setService(value)}>
<Option value="spotify">Spotify</Option>
<Option value="appleMusic">Apple Music</Option>
</Select>