Select

Displays a list of options for the user to pick from—triggered by a button.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::select::*;

#[component]
pub fn SelectAnatomy() -> impl IntoView {
    view! {
        <Select>
            <SelectContent>
                <SelectItem />
            </SelectContent>
        </Select>
    }
}

API Reference

Select

Contains all the parts of the Select.

Custom Attributes
NameTypeDefaultDescription
defaultString""

Set the default selected value. Setting value overrides this setting.

invalidboolfalse

Toggle invalid appearance and behavior.

valueReactive<String>""

A reactive value coupled to the currently selected item's value.

Implements global and select attributes.

SelectContent

Contains a group of items for the Select.

Implements global and optgroup attributes.

SelectItem

Contains an item with a value to be selected.

Implements global and option attributes.