Skip to content

TkxSelect

Single select with grouping
import { TkxSelect } from 'tekivex-ui';
const options = [
{ value: 'us', label: 'United States' },
{ value: 'in', label: 'India' },
{ value: 'jp', label: 'Japan' },
];
<TkxSelect
label="Country"
options={options}
onChange={(value) => console.log(value)}
/>
Searchable
<TkxSelect
label="Country"
options={options}
searchable
/>

The search input filters options by label. placeholder and the search input’s aria-label come from the active locale.

Multi-select with clearable
const [values, setValues] = useState<string[]>([]);
<TkxSelect
label="Tags"
options={tagOptions}
multiple
clearable
value={values}
onChange={setValues}
/>

Selected tags render as chips inside the field. clearable adds a clear button with a localised aria-label.

const options = [
{ value: 'us', label: 'United States', group: 'Americas' },
{ value: 'br', label: 'Brazil', group: 'Americas' },
{ value: 'in', label: 'India', group: 'Asia' },
{ value: 'jp', label: 'Japan', group: 'Asia' },
];

Group headers render as non-interactive list items.

For very long option lists (5000+), enable virtual scroll:

<TkxSelect
options={hugeList}
virtualScroll
optionHeight={36}
maxMenuHeight={280}
/>
  • ARIA combobox + listbox pattern (WAI-ARIA 1.2)
  • Keyboard: arrows navigate, Enter selects, Escape closes, Home / End jump to first / last option, type-ahead jump
  • Active descendant tracked via aria-activedescendant
  • Selected state via aria-selected
  • Disabled options skipped during keyboard navigation
PropTypeRequiredDescription
optionsSelectOption[]yes{ value, label, group?, disabled?, icon?, description? }.
valuestring | string[]Controlled value.
defaultValuestring | string[]Uncontrolled initial value.
placeholderstringLocalised by default.
multiplebooleanMulti-select mode.
searchablebooleanEnable filter input.
clearablebooleanShow clear button.
isLoadingbooleanShow loading state in menu.
renderOption(opt) => ReactNodeCustom option row.
virtualScrollbooleanFor long lists.

src/components/TkxSelect.tsx