Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

ListBox overview

TailNG ListBox ships as headless primitives. Use tngListbox on the owned list container and tngOption on each option host to keep roving focus, selection, and typeahead behavior consistent while you fully control the DOM.

Imports

Primitive import

ts
import { TngListboxDirective, TngOptionDirective } from '@tailng-ui/primitives';

Usage baseline

Listbox primitive usage

html
<div
  tngListbox
  tabindex="0"
  [multiple]="true"
  [value]="selectedValues()"
  (valueChange)="selectedValues.set(toArray($event))"
>
  @for (option of options; track option.id) {
    <div tngOption [tngValue]="option.id">{{ option.label }}</div>
  }
</div>

Listbox variants

The same primitive contract rendered with an owned plain-CSS shell and a light Tailwind shell.

Plain CSS listbox

Accessibility baseline

Keyboard and ARIA contracts for deterministic interaction behavior.

Components integration

Shared primitives and wrappers for TailNG form controls.

Styling contracts

State hooks and CSS contracts for custom product skins.

Testing harness

Regression suites for keyboard, pointer, and typeahead behavior.

Wrapper roadmap (disabled)

Upcoming wrapper exploration for richer listbox composition.

selected: Components integration

Behavior baseline

  • Arrow keys drive active option roving inside the focused listbox.
  • Space toggles active selection and Enter commits selection.
  • Typeahead is enabled by default for printable keys.
  • Tab leaves the current listbox; option nodes stay out of the normal tab order.
  • State hooks are exposed through data-active, data-selected, and data-disabled.