Skip to main content

ListBox

Examples#

Basic#

export function App() {    return (        <Window>            <DemoLayout width="200dpx" height="300dpx">                <ListBox                    items={['a', 'b', 'c']}                    onSelectionEnd={(sender) => {                        console.log(sender.GetSelection());                    }}                ></ListBox>            </DemoLayout>        </Window>    );}

Display a list of items, and get index of selected item:

list box basic

In console:

012

API#

export interface IListBoxComponentProps extends IComponentProps {    items?: string[];    onSelectionEnd?: Parameters<IListBox['OnSelectionEnd']>[0];}