Tree Select
Introduction
Section titled “Introduction”A form control for choosing one or several nodes of a hierarchy: a combobox-style field (aria-haspopup="tree") whose popup is a Tree View. Typing filters the tree while the paths to matches stay visible; Down Arrow moves focus into the tree, where the APG tree keys apply. Single mode closes the popup on choice; multiple mode uses tri-state checkboxes and shows the values as removable tags, like Multi Select. It supports lazy children, a clear button, required validation, Form integration, and hidden inputs for native form submission. The popup renders in the top layer (Popover API) with the shared positioning engine used by Select, Combobox, and Multi Select.
- A tree in a fieldA combobox whose popup is a Tree View: type to filter, Down Arrow to move into the tree.
- One or manySingle choice closes on selection; multiple choice uses tri-state checkboxes and removable tags.
- Lazy hierarchiesChildren load on expansion; labels of unloaded values come from valueLabels.
- A real form controlRequired validation, Form integration, a clear button, and hidden inputs for native submission.
Use it for
- Picking a department, cost center, location, or category from a hierarchy in a form.
- Choosing several nodes of a hierarchy where checking a parent means all of its children (permissions, regions).
Use something else for
- Flat option lists: use Select, Combobox, or Multi Select.
- Browsing or editing a hierarchy outside a form: use Tree View.
- A cascade of dependent levels shown side by side: use separate Selects.
Anatomy
<div class="aui-tree-select aui-tree-select--multiple"> <label class="aui-tree-select__label" for="...">Locations</label> <div class="aui-tree-select__control"> <ul class="aui-tree-select__tags" aria-label="Selected: Locations"> <li class="aui-tree-select__tag"><span class="aui-tree-select__tag-label">Europe</span><button class="aui-tree-select__remove" aria-label="Remove Europe"></button></li> </ul> <input class="aui-tree-select__input" role="combobox" aria-haspopup="tree" aria-expanded="false" aria-controls="tree-id"> <button class="aui-tree-select__clear" aria-label="Clear selection"></button> <button class="aui-tree-select__toggle" tabindex="-1" aria-label="Show options" aria-expanded="false"></button> </div> <div class="aui-tree-select__description">...</div> <div class="aui-tree-select__error">...</div> <span class="aui-tree-select__values" hidden><input type="hidden" name="locations" value="emea"></span> <div class="aui-tree-select__popup" popover="manual"><div class="aui-tree-select__tree aui-tree-view">...</div></div></div>Live example
Section titled “Live example”Use the bar above each frame to switch theme, density, direction, and locale.
Tree Select in the Navigation and commands showcase
Section titled “Tree Select in the Navigation and commands showcase”The part of the Navigation and commands showcase that uses Tree Select. Change its options, use it with the keyboard, and watch the event log; the link in the frame opens the full showcase. The bar above the frame switches theme, density, direction, and locale.
Showcase source
// Navigation and commands showcase: a document tree with lazy folders, drag-and-drop,// rename, checkboxes, and a filter; a Tree Select for a department; and a command palette// opened with Ctrl+K (Cmd+K) or a button, with nested pages and a simulated people search.import { Button } from '@absoluteui/components/button';import { CommandPalette, type Command, type CommandPaletteSelectDetail } from '@absoluteui/components/command-palette';import { TextInput } from '@absoluteui/components/text-input';import { TreeSelect, type TreeSelectChangeDetail } from '@absoluteui/components/tree-select';import { TreeView, type TreeNode, type TreeViewSelectDetail } from '@absoluteui/components/tree-view';import { action, choice, createShowcase, section, status, toggle, wait } from './kit.js';
const sc = createShowcase({ title: 'Navigation and commands', description: 'Browse the company documents (folders load when opened), drag or cut and paste to reorganize, press F2 to rename, pick a department, and press Ctrl+K (Cmd+K) for the command palette.', simulated: true,});
const DOCUMENTS: TreeNode[] = [ { id: 'policies', label: 'Policies', icon: 'list-bulleted', children: [ { id: 'leave', label: 'Leave policy', icon: 'file' }, { id: 'travel', label: 'Travel policy', icon: 'file' }, { id: 'expenses', label: 'Expenses policy', icon: 'file' }, { id: 'remote', label: 'Remote work policy', icon: 'file' }, ] }, { id: 'handbook', label: 'Employee handbook', icon: 'list-bulleted', children: [ { id: 'welcome', label: 'Welcome', icon: 'file' }, { id: 'benefits', label: 'Benefits', icon: 'list-bulleted', children: [{ id: 'health', label: 'Health insurance', icon: 'file' }, { id: 'pension', label: 'Pension plan', icon: 'file' }] }, { id: 'conduct', label: 'Code of conduct', icon: 'file' }, ] }, { id: 'payroll', label: 'Payroll (loads on open)', icon: 'list-bulleted', hasChildren: true }, { id: 'archive', label: 'Archive (loads on open)', icon: 'list-bulleted', hasChildren: true }, { id: 'legal', label: 'Legal hold (fails to load)', icon: 'list-bulleted', hasChildren: true }, { id: 'board', label: 'Board minutes (restricted)', icon: 'file', disabled: true },];
let failNext = true;const docsArea = section(sc, 'Company documents', ['tree-view']);const docsStatus = status(docsArea);docsStatus.textContent = 'Nothing selected.';const filterHost = document.createElement('div');const treeHost = document.createElement('div');docsArea.append(filterHost, treeHost);const tree = TreeView.create(treeHost, { label: 'Company documents', nodes: DOCUMENTS, selection: 'single', expanded: ['policies'], draggable: true, renamable: true, height: '20rem', // Folders other than Policies and Handbook are leaves, so documents cannot be dropped into files. canDrop: (_source, target, position) => position !== 'inside' || target === null || target.icon === 'list-bulleted', loadChildren: async (node, { signal }) => { await wait(700, signal); if (node.id === 'legal' && failNext) { failNext = false; throw new Error('Simulated server error'); } return Array.from({ length: node.id === 'archive' ? 60 : 6 }, (_, i) => ({ id: `${node.id}-${String(i + 1)}`, label: `${node.id === 'payroll' ? 'Payslip run' : 'Record'} ${String(2025 - Math.floor(i / 12))}-${String((i % 12) + 1).padStart(2, '0')}`, icon: 'file' })); },});sc.listen(treeHost, ['aui-select', 'aui-change', 'aui-expand', 'aui-move', 'aui-rename', 'aui-activate', 'aui-load-error'], 'tree');treeHost.addEventListener('aui-select', (e) => { const id = (e as CustomEvent<TreeViewSelectDetail>).detail.selected[0]; docsStatus.textContent = id === undefined ? 'Nothing selected.' : `Selected: ${tree.getNode(id)?.label ?? id}.`;});const filter = TextInput.create(filterHost, { label: 'Filter documents', type: 'search', description: 'Matches stay visible with the folders that contain them.' });filterHost.addEventListener('aui-input', () => { tree.update({ filter: filter.value });});
toggle(sc, 'Checkboxes', false, (checkboxes) => { tree.update({ checkboxes, selection: checkboxes ? 'none' : 'single' });}, ['tree-view']);toggle(sc, 'Multiple selection', false, (multiple) => { tree.update({ selection: multiple ? 'multiple' : 'single', selected: [] });}, ['tree-view']);toggle(sc, 'Drag and drop', true, (draggable) => { tree.update({ draggable });}, ['tree-view']);action(sc, 'Expand all', () => { tree.expandAll();}, ['tree-view']);action(sc, 'Collapse all', () => { tree.collapseAll();}, ['tree-view']);action(sc, 'Rename the selected document', () => { const id = tree.selected[0] ?? tree.activeId; if (id !== null) tree.rename(id);}, ['tree-view']);
const pickArea = section(sc, 'Department', ['tree-select']);const pickStatus = status(pickArea);const DEPARTMENTS: TreeNode[] = [ { id: 'eng', label: 'Engineering', children: [{ id: 'eng-web', label: 'Web' }, { id: 'eng-platform', label: 'Platform' }, { id: 'eng-data', label: 'Data and AI' }] }, { id: 'ops', label: 'Operations', children: [{ id: 'ops-facilities', label: 'Facilities' }, { id: 'ops-it', label: 'IT support' }, { id: 'ops-security', label: 'Security' }] }, { id: 'people', label: 'People and Culture', children: [{ id: 'people-recruiting', label: 'Recruiting' }, { id: 'people-learning', label: 'Learning' }] }, { id: 'finance', label: 'Finance', children: [{ id: 'finance-payroll', label: 'Payroll' }, { id: 'finance-tax', label: 'Tax' }] },];const selectHost = document.createElement('div');pickArea.append(selectHost);const department = TreeSelect.create(selectHost, { label: 'Department', name: 'department', required: true, placeholder: 'Choose a department', description: 'Type to filter; Down Arrow moves into the tree.', nodes: DEPARTMENTS });sc.listen(selectHost, ['aui-change'], 'tree-select');selectHost.addEventListener('aui-change', (e) => { const { value } = (e as CustomEvent<TreeSelectChangeDetail>).detail; pickStatus.textContent = value.length === 0 ? 'No department chosen.' : `Chosen: ${value.join(', ')}.`;});choice(sc, 'Department mode', [{ value: 'single', label: 'One department' }, { value: 'multiple', label: 'Several (checkboxes)' }], 'single', (mode) => { department.update({ mode, value: [] });}, ['tree-select']);toggle(sc, 'Teams only (parents open)', false, (teamsOnly) => { department.update({ selectableParents: !teamsOnly });}, ['tree-select']);
const cmdArea = section(sc, 'Command palette', ['command-palette']);const cmdStatus = status(cmdArea);cmdStatus.textContent = 'Press Ctrl+K (Cmd+K) or the button.';const PEOPLE = ['Ada Lovelace', 'Alan Turing', 'Barbara Liskov', 'Donald Knuth', 'Edsger Dijkstra', 'Grace Hopper', 'Katherine Johnson', 'Margaret Hamilton', 'Radia Perlman', 'Tim Berners-Lee'];const commands: Command[] = [ { id: 'go-dashboard', label: 'Go to dashboard', group: 'Navigation', icon: 'menu' }, { id: 'go-directory', label: 'Go to directory', group: 'Navigation', keywords: ['people', 'employees'], icon: 'menu' }, { id: 'go-documents', label: 'Go to documents', group: 'Navigation', icon: 'menu', run: () => { tree.focusNode('policies'); } }, { id: 'request-leave', label: 'Request leave', group: 'Actions', shortcut: 'Mod+Shift+L', icon: 'calendar', keywords: ['vacation', 'holiday'] }, { id: 'new-document', label: 'New document', group: 'Actions', shortcut: 'Mod+N', icon: 'plus' }, { id: 'export', label: 'Export report (no permission)', group: 'Actions', icon: 'download', disabled: true }, { id: 'theme', label: 'Change theme', group: 'Preferences', icon: 'eye', children: [ { id: 'theme-light', label: 'Light' }, { id: 'theme-dark', label: 'Dark' }, { id: 'theme-contrast', label: 'High contrast' }, ] }, { id: 'density', label: 'Change density', group: 'Preferences', icon: 'align-justify', children: [ { id: 'density-compact', label: 'Compact' }, { id: 'density-comfortable', label: 'Comfortable' }, { id: 'density-spacious', label: 'Spacious' }, ] },];const paletteHost = document.createElement('div');cmdArea.append(paletteHost);const palette = CommandPalette.create(paletteHost, { commands, recent: ['go-directory'], placeholder: 'Search pages, actions, and people', providers: [{ id: 'people', label: 'People', minQueryLength: 2, search: async (query, { signal }) => { await wait(350, signal); const q = query.toLowerCase(); return PEOPLE.filter((p) => p.toLowerCase().includes(q)).map((p) => ({ id: `person-${p}`, label: p, description: 'Employee', icon: 'search' })); }, }],});sc.listen(paletteHost, ['aui-select', 'aui-open', 'aui-close'], 'palette');paletteHost.addEventListener('aui-select', (e) => { const d = (e as CustomEvent<CommandPaletteSelectDetail>).detail; cmdStatus.textContent = `Chose ${d.command.label}${d.path.length > 0 ? ` (in ${d.path.join(' / ')})` : ''}.`;});const openButton = Button.create({ text: 'Open command palette', icon: 'search', variant: 'secondary' });openButton.element.addEventListener('click', () => { palette.open();});cmdArea.append(openButton.element);choice(sc, 'Palette shortcut', [{ value: 'Mod+K', label: 'Ctrl+K / Cmd+K' }, { value: 'Mod+Shift+P', label: 'Ctrl+Shift+P / Cmd+Shift+P' }], 'Mod+K', (shortcut) => { palette.update({ shortcut });}, ['command-palette']);action(sc, 'Open on the theme page', () => { palette.open({ page: 'theme' });}, ['command-palette']);Required department in a form
Section titled “Required department in a form”import { TreeSelect, type TreeSelectChangeDetail } from '@absoluteui/components/tree-select';
const host = document.createElement('div');document.body.append(host);const field = TreeSelect.create(host, { label: 'Department', name: 'department', required: true, placeholder: 'Choose a department', nodes: [ { id: 'eng', label: 'Engineering', children: [ { id: 'eng-platform', label: 'Platform' }, { id: 'eng-web', label: 'Web' }, ] }, { id: 'ops', label: 'Operations', children: [{ id: 'ops-facilities', label: 'Facilities' }] }, ],});host.addEventListener('aui-change', (event) => { const { value } = (event as CustomEvent<TreeSelectChangeDetail>).detail; host.dataset.department = value[0] ?? '';});field.reportValidity();Several locations with tri-state checkboxes and lazy children
Section titled “Several locations with tri-state checkboxes and lazy children”import { TreeSelect, type TreeNode } from '@absoluteui/components/tree-select';
const host = document.createElement('div');document.body.append(host);TreeSelect.create(host, { label: 'Locations', mode: 'multiple', name: 'locations', value: ['berlin'], valueLabels: { berlin: 'Berlin' }, nodes: [ { id: 'emea', label: 'Europe', hasChildren: true }, { id: 'apac', label: 'Asia Pacific', hasChildren: true }, ], loadChildren: async (node, { signal }) => { const res = await fetch(`/api/locations?parent=${encodeURIComponent(node.id)}`, { signal }); return (await res.json()) as TreeNode[]; },});Install and start
Section titled “Install and start”npm install @absoluteui/components @absoluteui/core @absoluteui/themeRegistry setup, the theme stylesheet, and the Content Security Policy are covered in Installation.
import { TreeSelect } from '@absoluteui/components/tree-select';import '@absoluteui/components/tree-view/style.css';import '@absoluteui/components/tree-select/style.css';First use
Section titled “First use”import { TreeSelect } from '@absoluteui/components/tree-select';import '@absoluteui/components/tree-view/style.css';import '@absoluteui/components/tree-select/style.css';
const host = document.querySelector<HTMLElement>('#dept');if (host) TreeSelect.create(host, { label: 'Department', name: 'department', nodes: [{ id: 'eng', label: 'Engineering' }, { id: 'ops', label: 'Operations' }] });More usage
import { TreeSelect } from '@absoluteui/components/tree-select';
const host = document.querySelector<HTMLElement>('#location');if (host) { TreeSelect.create(host, { label: 'Work location', name: 'location', nodes: [{ id: 'de', label: 'Germany', children: [{ id: 'ber', label: 'Berlin' }, { id: 'muc', label: 'Munich' }] }], selectableParents: false, });}Using Angular? See Tree Select for Angular.
API reference
Section titled “API reference”Factory
Section titled “Factory”TreeSelect.create(host: HTMLElement, options: TreeSelectOptions): TreeSelectGlobal configuration key: treeSelect (see Configuration).
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
label |
string |
Visible label (accessible name). Required. | |
nodes |
readonly TreeNode[] |
The tree (see Tree View). Required. | |
mode |
'single' | 'multiple' |
"single" |
Single choice or multiple choice with checkboxes and tags. |
value |
readonly string[] |
"[]" |
Selected node ids (at most one in single mode). |
name |
string |
Form field name; one hidden input per selected id. | |
placeholder |
string |
Placeholder while nothing is selected. | |
description |
string |
Help text below the field. | |
required |
boolean |
"false" |
At least one value is required. |
disabled |
boolean |
"false" |
Not interactive and not submitted by Form. |
readOnly |
boolean |
"false" |
Focusable, but the value cannot change. |
invalid |
boolean |
"false" |
Show errorMessage as an external error. |
errorMessage |
string |
Message shown while invalid is true. | |
clearable |
boolean |
"true" |
Show a button that clears the selection. |
selectableParents |
boolean |
"true" |
Single mode: parents can be chosen; otherwise choosing a parent opens it. |
cascade |
boolean |
"true" |
Multiple mode: checking a parent checks its descendants. |
expanded |
readonly string[] |
Ids expanded in the popup tree (paths to the value are expanded too). | |
loadChildren |
((node: TreeNode, context: TreeViewLoadContext) => Promise<readonly TreeNode[]>) | null |
Lazy children (see Tree View). | |
valueLabels |
Readonly<Record<string, string>> |
Labels of selected ids whose nodes are not loaded yet. | |
popupHeight |
string |
"16rem" |
Block size of the tree in the popup. |
direction |
'ltr' | 'rtl' |
Popup placement and tree arrow keys. Globally configurable. Inherited from common configuration. | |
density |
'compact' | 'comfortable' | 'spacious' |
Row height of the popup tree. | |
icons |
Partial<TreeSelectIcons> |
Expand, clear, remove, and error icons. | |
openOnFocus |
boolean |
"false" |
Open the popup when the field receives focus. Globally configurable. |
locale |
string |
"en-US" |
Locale of messages and filtering. Globally configurable. Inherited from common configuration. |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
host |
HTMLElement |
The host element. |
input |
HTMLInputElement |
The search field (role=combobox). |
value |
string[] |
Selected node ids. |
isOpen |
boolean |
Whether the popup is open. |
tree |
TreeView | null |
The Tree View in the popup. |
name |
string | null |
Form field name. |
label |
string |
Accessible label. |
disabled |
boolean |
Disabled state. |
validity |
FieldValidity |
Current validity. |
dirty |
boolean |
The value differs from the initial value. |
touched |
boolean |
The field lost focus at least once. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
open(): void |
Open the popup. |
close(): void |
Close the popup. |
setValue(value: readonly string[]): void |
Set the value (no aui-change). |
getFormValue(): string[] | string | null |
The id (single) or ids (multiple) for Form. |
reportValidity(): boolean |
Show messages and return validity. |
setCustomError(message: string | null): void |
External error; null clears it. |
focus(): void |
Focus the field. |
reset(): void |
Restore the initial value and clear interaction state. |
update(options: Partial<TreeSelectOptions>): void |
Merge and apply options. |
destroy(): void |
Remove rendering and listeners. |
Events
Section titled “Events”| Event | Detail | Bubbles | Cancelable | Description |
|---|---|---|---|---|
aui-change |
TreeSelectChangeDetail |
Yes | No | The user changed the value: { value, added, removed }. |
aui-input |
{ query: string } |
Yes | No | The search text changed. |
aui-open |
null |
No | No | The popup opened. |
aui-close |
null |
No | No | The popup closed. |
CSS classes
Section titled “CSS classes”All rules live in the aui.components cascade layer, so application styles override them without specificity battles.
| Class | Purpose |
|---|---|
aui-tree-select |
Host. |
aui-tree-select--multiple | --invalid | --disabled |
Multiple mode, invalid, disabled. |
aui-tree-select__label | __control | __input |
Label, field boundary, and search input. |
aui-tree-select__tags | __tag | __tag-label | __remove |
Selected value tags (multiple). |
aui-tree-select__clear | __toggle |
Clear and open buttons. |
aui-tree-select__popup | __tree |
Top-layer popup and the Tree View host. |
aui-tree-select__description | __error | __values |
Help text, error message, hidden inputs. |
Icon slots
Section titled “Icon slots”| Slot | Default icon |
|---|---|
expand |
chevron-down |
clear |
close |
remove |
close |
error |
alert-circle |
Design tokens
Section titled “Design tokens”Tokens this stylesheet reads (verified in CI). Override them in a theme or with the Theme Designer.
--aui-border-width | --aui-color-border | --aui-color-border-strong | --aui-color-disabled-bg | --aui-color-error-fg | --aui-color-focus-ring | --aui-color-hover | --aui-color-surface | --aui-color-surface-sunken | --aui-color-text | --aui-color-text-disabled | --aui-color-text-muted | --aui-control-height-md | --aui-control-height-sm | --aui-control-padding-x | --aui-duration-fast | --aui-easing-standard | --aui-focus-ring-offset | --aui-focus-ring-width | --aui-font-family-sans | --aui-font-size-md | --aui-font-size-sm | --aui-font-weight-medium | --aui-icon-size-sm | --aui-line-height-normal | --aui-line-height-tight | --aui-popover-max-height | --aui-radius-md | --aui-radius-sm | --aui-shadow-md | --aui-space-1 | --aui-space-2 | --aui-touch-target-min
TypeScript definitions
type TreeSelectMode = 'single' | 'multiple';interface TreeSelectConfig { openOnFocus: boolean }interface TreeSelectOptions extends Partial<TreeSelectConfig> { label: string; nodes: readonly TreeNode[]; mode?: TreeSelectMode; value?: readonly string[]; name?: string; placeholder?: string; description?: string; required?: boolean; disabled?: boolean; readOnly?: boolean; invalid?: boolean; errorMessage?: string; clearable?: boolean; selectableParents?: boolean; cascade?: boolean; expanded?: readonly string[]; loadChildren?: ((node: TreeNode, context: TreeViewLoadContext) => Promise<readonly TreeNode[]>) | null; valueLabels?: Readonly<Record<string, string>>; popupHeight?: string; locale?: string; direction?: 'ltr' | 'rtl'; density?: Density; icons?: Partial<TreeSelectIcons>;}interface TreeSelectChangeDetail { value: string[]; added: string[]; removed: string[] }Accessibility and performance
Section titled “Accessibility and performance”Accessibility
Section titled “Accessibility”Pattern: WAI-ARIA 1.2 combobox with a tree popup (aria-haspopup=tree). The field keeps focus while typing; Down Arrow moves DOM focus into the popup tree, which follows the APG tree pattern (see Tree View); Escape returns focus to the field.
Checked on every docs build: the showcase passes axe (WCAG 2.2 A and AA rules) in the default, dark, and high-contrast themes and right to left; the playground loads without errors and passes axe before and after every on/off option is switched, with no Content Security Policy violations.
Keyboard
Section titled “Keyboard”| Key | Context | Action |
|---|---|---|
| Typing | Field | Filter the tree (opens the popup); the paths to matches stay visible. |
| Down / Up | Field | Open and move focus into the tree (the selected node, or the first or last node). |
| Alt + Down | Field | Open without moving focus. |
| Enter | Field, popup open | Move focus into the tree. |
| Escape | Field | Close the popup, or clear the search text. |
| Backspace | Empty field, multiple mode | Remove the last tag. |
| Tree keys | Popup tree | Arrows, Home, End, type-ahead, * (see Tree View); Enter or Space chooses (single) or Space toggles the checkbox (multiple). |
| Escape / Tab | Popup tree | Close the popup and return focus to the field. |
| Element | Role |
|---|---|
| input | combobox |
| popup tree | tree |
| node | treeitem |
| tags | list (ul) with labelled remove buttons |
ARIA attributes
Section titled “ARIA attributes”| Attribute | Element | Value |
|---|---|---|
aria-haspopup |
combobox | tree |
aria-expanded |
combobox and open button | true while the popup is open |
aria-controls |
combobox and open button | the tree id |
aria-required / aria-invalid / aria-describedby |
combobox | required, error state, and help or error text |
aria-label |
tree | “<label> options” |
aria-checked |
treeitem | true, false, or mixed in multiple mode |
aria-selected |
treeitem | true on the chosen node in single mode |
Focus stays on the field until the user moves into the tree; choosing in single mode closes the popup and returns focus to the field. Leaving the control closes the popup and marks it touched (validation shows after blur).
WCAG 2.2 success criteria addressed
Section titled “WCAG 2.2 success criteria addressed”Automated test results: Accessibility and compliance.
Notes and known caveats
Section titled “Notes and known caveats”- Added, removed, and cleared values are announced politely (WCAG 4.1.3).
- Tags have remove buttons named “Remove <label>”; the clear button is named “Clear selection”.
- Screen readers announce the popup as a tree only after focus moves into it.
- Manual screen-reader verification (NVDA, JAWS, VoiceOver) is pending.
Performance
Section titled “Performance”| Import cost | Minified | gzip | brotli | CSS brotli |
|---|---|---|---|---|
@absoluteui/components/tree-select |
83.6 kB | 27.0 kB | 24.1 kB | 1.3 kB |
Measured at build time, including every AbsoluteUI module the component pulls in. No third-party runtime dependencies.
| Budget (enforced in CI) | Limit |
|---|---|
| TreeSelect.create with 5,000 nodes | < 30 ms average in headless Chromium |
| Rendered treeitems in the popup | visible rows + 2 x overscan + 1 (virtualized Tree View) |
Tested scale: 10,000 nodes (the popup tree is virtualized); multiple values tested with 200 tags.
The popup tree is a virtualized Tree View created once, so loaded children and expansion survive closing and reopening. Filtering is one pass over loaded nodes per keystroke.
Measured run times: Performance.
Details
Section titled “Details”States
Closed; open; filtering; no matches; loading children; load failed; selected; multiple tags; required missing; invalid; disabled; read-only.
State transitions
| From | Trigger | To |
|---|---|---|
| closed | typing, Down/Up, open button, focus with openOnFocus |
open |
| open | choosing a node (single) | closed, value set, aui-change, focus on the field |
| open | toggling a checkbox (multiple) | value updated, aui-change, popup stays open |
| open | Escape, Tab, outside pointer | closed; the search text is cleared |
| selected | clear button, tag remove button, Backspace on an empty field | value reduced, aui-change |
| untouched | leaving the control | touched; a required error shows |
Accessibility notes
- Additions, removals, and clearing are announced politely (WCAG 4.1.3).
- Validation messages appear after blur or submit.
- The e2e axe run covers three themes with the popup open; manual screen-reader verification is pending.
Responsive behavior
Fills its container; tags wrap inside the field. The popup matches the field width, flips above it when there is no room below, and limits its height to the available space.
Right-to-left
The field, tags, and buttons follow the writing direction; the popup tree mirrors indentation and arrow keys.
Theming
Three themes through the role tokens; invalid fields use color-error-fg; forced colors keep boundaries visible.
Global configuration
configureAbsoluteUI({ components: { treeSelect: { openOnFocus: true } } });Component configuration
Instance openOnFocus, locale, and direction override configuration.
Icons
icons.expand (chevron-down), icons.clear (close), icons.remove (close), icons.error (alert-circle). Node icons come from the nodes.
Security
Labels are text; hidden inputs carry node ids. No HTML is parsed.
Data handling
No persistence, network access, or telemetry. loadChildren is the application’s function with an AbortSignal.
Supported data scale
Tested with 10,000 nodes and 200 tags.
Edge cases
- Ids in
valuewhose nodes are not loaded show theirvalueLabelsentry, or the id. - With cascade, setting a parent id checks its loaded descendants, so
valuegrows to include them. - Removing a tag of a fully checked parent unchecks its descendants too.
- Single mode rejects more than one id in
value.
Errors
| Code | Category | Cause |
|---|---|---|
TREE_SELECT_OPTIONS |
configuration | Blank label, nodes not an array, unknown mode, non-string ids in value, more than one id in single mode, valueLabels that is not a record of strings, or non-boolean flags. |
TREE_VIEW_OPTIONS |
configuration | Invalid nodes (see Tree View). |
CFG_INVALID_VALUE / CFG_UNKNOWN_OPTION |
configuration | Invalid or unknown configuration. |
Known limitations
- Filtering searches loaded nodes only.
- Multiple mode with cascade stores parents and children; tags show the topmost fully checked node.
- Manual screen-reader verification is pending.
Unsupported scenarios
- Free-text values that are not nodes.
- Parent-only or leaf-only value modes (filter the value in
aui-change).
(c) 2026 Kasadara Technology Solutions Pvt Ltd. AbsoluteUI is free to use under the AbsoluteUI Free Use License; it is not open source.