Skip to main content
.pickerStyle(style: PickerStyle): Component
style
PickerStyle
required
The visual style for the picker. See PickerStyle.Options: "automatic", "segmented", "inline", "menu", "navigationlink", "palette", "radiogroup", "wheel".

Support

Usage

Segmented picker

const body = () => {
    const [size, setSize] = useState("m")
    return Picker("Size", { value: size, setValue: setSize }, [
        Text("S").tag("s"),
        Text("M").tag("m"),
        Text("L").tag("l"),
    ]).pickerStyle("segmented")
}

Wheel picker

const body = () => {
    const [selection, setSelection] = useState("a")
    return Picker("Option", { value: selection, setValue: setSelection }, [
        Text("Alpha").tag("a"),
        Text("Beta").tag("b"),
        Text("Gamma").tag("g"),
    ]).pickerStyle("wheel")
}
const body = () => {
    const [color, setColor] = useState("red")
    return Picker("Color", { value: color, setValue: setColor }, [
        Text("Red").tag("red"),
        Text("Green").tag("green"),
        Text("Blue").tag("blue"),
    ]).pickerStyle("menu")
}