Listbox
Listbox. It is copied into your app’s ui/ by qatjs add listbox: the code is yours to edit.
Example
Courier: none
// <Listbox> is the list inside <Select>, <Combobox> and <CommandPalette>: it holds no focus,
// the control that opens it keeps it. Here, through a Combobox:
import { Combobox } from './ui/combobox/combobox.qx'
export default function Example() {
let courier = state<string | undefined>(undefined)
return (
<Combobox
label="Courier"
options={[
{ value: 'azp', label: 'Azərpoçt' },
{ value: 'aze', label: 'AzərExpress' },
{ value: 'dhl', label: 'DHL', disabled: true },
]}
bind:value={courier}
/>
<p>Courier: {courier ?? 'none'}</p>
)
}courier stateAdd it
npx qatjs add listboxListbox
The listbox: groups, options (the active one, the chosen ones), and the combobox's extra rows. As a custom element: <ui-listbox>.
| Prop | Type | Attribute |
|---|---|---|
id | string | yes |
anchor | Element | property only |
options | SelectOption[] | property only |
active | number | yes |
chosen | (o: SelectOption) => boolean | property only |
pick | (i: number) => void | property only |
hover | (i: number) => void | property only |
close | () => void | property only |
multiple | boolean | yes |
label | string | yes |
query | string | yes |
loading | boolean | yes |
empty | string | yes |
create | string | yes |
inline | boolean | yes |
Keys
| Key | Does |
|---|---|
| (none) | it holds no focus: the control that opens it keeps its keys |