Controls
The components of songstress/ui for controls, each as Songstress draws it, with its props and an example.
What a person presses, switches, slides, picks and types. Each takes its value and tells your handler what the person chose: an action anywhere, a function in client code (see State and handlers).
Each picture is the SDK’s own test tree for the component, drawn by the web app; every app draws the same tree with its own controls, the phones natively. Each example is the one in the SDK’s doc comment, which its tests compile, and the props are read from its types.
Button


A button: a button node, onPress its action.
import { Button, Text, useState } from 'songstress/ui'
function Counter() {
const [count, setCount] = useState(0)
return (
<>
<Text>{`Pressed ${count} times`}</Text>
<Button title="Add one" icon="add" emphasis="primary" onPress={() => setCount((was) => was + 1)} />
</>
)
}In the reference: Button.
Prop
Type
IconButton


A button that shows an icon alone: an icon-button node, onPress its action.
import { IconButton } from 'songstress/ui'
const reload = <IconButton icon="refresh" label="Look again" onPress={{ type: 'refresh' }} />In the reference: IconButton.
Prop
Type
Menu


A button that opens a menu: a menu node, its entries its MenuOption children.
import { Menu, MenuOption } from 'songstress/ui'
const more = (
<Menu title="More" icon="settings">
<MenuOption title="Look again" icon="refresh" onSelect={{ type: 'refresh' }} />
<MenuOption title="Say hello" onSelect={() => ({ type: 'toast', message: 'Hello' })} />
</Menu>
)In the reference: Menu.
Prop
Type
MenuOption
A menu item: one entry of a Menu, or of a ListItem's, a TreeItem's or a MediaCard's menu. onSelect is what choosing it does.
import { confirmed, Menu, MenuOption } from 'songstress/ui'
const more = (
<Menu title="More">
<MenuOption title="Forget every play" icon="trash" destructive onSelect={confirmed({ title: 'Forget every play?' }, { type: 'invoke', command: 'forget' })} />
</Menu>
)In the reference: MenuOption.
Prop
Type
Switch


On or off, as a switch: a switch node, told a boolean.
import { Switch, useState } from 'songstress/ui'
function Loud() {
const [loud, setLoud] = useState(false)
return <Switch label="Loud" help="Plays the next song louder." value={loud} onChange={setLoud} />
}In the reference: Switch.
Prop
Type
Checkbox


On or off, as a checkbox: a checkbox node, told a boolean.
import { Checkbox, useState } from 'songstress/ui'
function Intros() {
const [skip, setSkip] = useState(true)
return <Checkbox label="Skip intros" value={skip} onChange={setSkip} />
}In the reference: Checkbox.
Prop
Type
Slider


A number in a range: a slider node, told a number.
import { Slider, useState } from 'songstress/ui'
function Fade() {
const [seconds, setSeconds] = useState(4)
return <Slider label="Fade" value={seconds} minimum={0} maximum={12} step={1} onChange={setSeconds} />
}In the reference: Slider.
Prop
Type
Select


One of a list, in a menu: a select node, told the option's value.
import { Select, useState } from 'songstress/ui'
const ORDERS = [
{ value: 'recent', title: 'Most recent' },
{ value: 'plays', title: 'Most played' },
]
function Order() {
const [order, setOrder] = useState('recent')
return <Select label="Sort by" options={ORDERS} value={order} onChange={setOrder} />
}In the reference: Select.
Prop
Type
Segmented


One of a few, side by side: a segmented node, told the option's value.
import { Segmented, useState } from 'songstress/ui'
function Span() {
const [span, setSpan] = useState('week')
return (
<Segmented
label="Over"
options={[{ value: 'week', title: 'Week' }, { value: 'year', title: 'Year' }]}
value={span}
onChange={setSpan}
/>
)
}In the reference: Segmented.
Prop
Type
TextInput


A line of text, or several: a text-field node, told what it holds.
import { TextInput, useState } from 'songstress/ui'
function MixName() {
const [name, setName] = useState('')
return (
<TextInput
label="Name"
placeholder="A name for the mix"
value={name}
onChange={setName}
onSubmit={(value) => ({ type: 'toast', message: `Saved ${value}` })}
/>
)
}In the reference: TextInput.
Prop
Type
SearchField


The app's search field: a search-field node, told what it holds.
import { SearchField, useState } from 'songstress/ui'
function Find() {
const [term, setTerm] = useState('')
return <SearchField placeholder="Search your plays" value={term} onChange={setTerm} />
}In the reference: SearchField.
Prop
Type
DatePicker


A day: a date-picker node, told the day as YYYY-MM-DD.
import { DatePicker, useState } from 'songstress/ui'
function Since() {
const [since, setSince] = useState('2026-11-01')
return <DatePicker label="Since" value={since} maximum="2026-12-31" onChange={setSince} />
}In the reference: DatePicker.
Prop
Type