Skip to main content
List<V = string>(props: ListProps<V>, children: Component[]): Component;
List(children: Component[]): Component;

Parameters

props.selection
V
The currently selected value.
props.setSelection
(value: V) => void
Function called when selection changes.
children
Component[]
Array of components to display as list items.

Support

Usage

Basic list

List([
    Text("Item 1"),
    Text("Item 2"),
    Text("Item 3")
])

List with selection

const [selectedItem, setSelectedItem] = useState("Item 1")

List(
    { 
        selection: selectedItem, 
        setSelection: setSelectedItem 
    },
    [
        Text("Item 1"),
        Text("Item 2"), 
        Text("Item 3")
    ]
)