Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

OrderList

Reorder a selectable list with keyboard, buttons or optional drag and drop.

Category
Forms and selection
Import
@neural-ui/core/pick-list
Selector
neu-order-list
import { NeuOrderListComponent } from '@neural-ui/core/pick-list';

Usage

Use stable option values to identify items. selectionChange supplies selected items; orderChange proposes the new array. Apply that array to items to accept a reorder. Filtering changes the visible subset, not the source collection. dragDrop is optional; buttons and keyboard offer the same operation.

Examples

Try this application-owned interaction. Its event handling and initial data are included in Code.

Examples

Events: 0

Try and configure

Change the public options, try the result and inspect the updated template. Code contains the complete executable implementation.

Try and configure

Events: 0

template.html
<neu-order-list
  (filterChange)="onFilterChange($event)"
  [items]="available()"
  [filter]="true"
  [dragDrop]="false"
  [selectionKeys]="selected()"
  (selectionChange)="selected.set($event.map(itemKey))"
  (orderChange)="available.set($event); record('orderChange', $event)"
  [ariaLabel]="'Ordered projects'"
  [emptyFilterLabel]="'No matching projects'"
  [filterLabel]="'Filter projects'"
  [filterPlaceholder]="'Search projects'"
></neu-order-list>

State and events

Use stable option values to identify items. selectionChange supplies selected items; orderChange proposes the new array. Apply that array to items to accept a reorder. Filtering changes the visible subset, not the source collection. dragDrop is optional; buttons and keyboard offer the same operation.

Accessibility and keyboard

Use Tab to reach items and reorder buttons. Enter or Space selects an item or activates a reorder button. These controls remain available when dragDrop is false.

Key
Action
Tab Move through item buttons and the available reorder or transfer buttons.
Enter Select the focused item or activate the focused reorder/transfer button. Dragging is not required.
Space Select the focused item or activate the focused reorder/transfer button. Dragging is not required.

API

Inputs, models and Outputs are extracted from the installed Core package. Named public types link to their definitions. Templates below include executable examples.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
ariaLabelstring'Ordered items'[ariaLabel]Accessible name of the control or region.
dragDropbooleanfalse[dragDrop]Enable optional pointer drag/drop; keyboard and button operations remain available.
emptyFilterLabelstring'No matching items'[emptyFilterLabel]Text displayed when filtering produces no matching entries.
filterbooleanfalse[filter]Changed raw search query from user input.
filterConfigReadonly<NeuOptionFilterConfig<T>>{}[filterConfig]Fields, matching mode, locale and client/server filtering strategy.
filterLabelstring'Filter ordered items'[filterLabel]Accessible name or placeholder for the corresponding list filter.
filterPlaceholderstring'Filter items'[filterPlaceholder]Accessible name or placeholder for the corresponding list filter.
filterValuestring | nullnull[filterValue]Applied search query. Listen to filterChange when the application controls it.
itemsreadonly T[][][items]Applied item collection. Stable keys and accessors identify entries; the component does not mutate the array.
optionDisabledNeuOptionDisabledAccessor<T> | nullnull[optionDisabled]Field name or function that marks an option as disabled.
optionLabelNeuOptionLabelAccessor<T> | nullnull[optionLabel]Field name or function used to obtain the visible option label.
optionValueNeuOptionValueAccessor<T, V> | nullnull[optionValue]Field name or function used to obtain the stored option value.
selectionKeysreadonly V[] | undefinedundefined[selectionKeys]Applied stable option values for selected entries. Undefined uses the local selection mode.

Outputs

Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.

Name
Payload
Template binding
Description
filterChangestring(filterChange)="onFilterChange($event)"Proposes the complete updated filter array, including active states. Replace filters to accept it.
itemDropNeuPickListDropEvent<T>(itemDrop)="onItemDrop($event)"Reports a pointer/keyboard drop with item, list locations and indexes. Apply the associated state proposal to accept it.
orderChangeT[](orderChange)="onOrderChange($event)"Proposes the complete reordered array. Replace items or tiles to accept it.
selectionChangeT[](selectionChange)="onSelectionChange($event)"Proposes selection together with the affected key and interaction source. Apply payload.selection to selection.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

Name
Mechanism
Contract
NeuOrderListItemDirectiveView example Public template directive (entrypoint)ng-template[neuOrderListItem]

Each example demonstrates a different template. Switch between Demo and Code to inspect its implementation, imports and state.

NeuOrderListItemDirective

NeuOrderListItemDirective

NeuOrderListItemDirective

Events: 0

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Use the supported public tokens listed below. Surrounding layout belongs to your application; validate the result in light and dark modes and narrow containers.

Specific tokens

This component uses shared theme tokens rather than dedicated component hooks.

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
No data