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

CascadeSelect

Navigate through grouped levels and select a leaf destination.

Category
Forms and selection
Import
@neural-ui/core/cascade-select
Selector
neu-cascade-select
import { NeuCascadeSelectComponent } from '@neural-ui/core/cascade-select';

Usage

Each parent opens its children. The model changes only when a selectable leaf is chosen. The default node shape contains label, value and optional children; accessors support other domain shapes.

Use the back action or the breadcrumb to move between levels without inventing a second selection value.

Signal Forms

Bind FormField to the value-owning control and add required to the form schema. Select a destination, leave the field to mark it touched, and reset it to check both value and validation state. A required marker on its own does not validate your form.

Signal Forms guide

Signal Forms

Value: โ€” ยท Valid: false

Try and configure

Change the settings below and interact with the live control. The preview, current application value and generated template stay together. A disabled destination lets you check that unavailable choices cannot be selected.

Try and configure
Live preview

Events: 0 ยท

Generated template: reflects the settings above. Imports and state are in the Code tab.

template.html
<neu-cascade-select
  (opened)="record('opened', $event)"
  (closed)="record('closed', $event)"
  (groupChange)="record('groupChange', $event)"
  (optionActivated)="record('optionActivated', $event)"
  (touch)="record('touch', $event)"
  (valueChange)="record('valueChange', $event)"
  [options]="destinations"
  [(value)]="destination"
  [clearable]="true"
  [backAriaLabel]="'Back'"
  [breadcrumbAriaLabel]="'Destination path'"
  [emptyLabel]="'No destinations'"
  [label]="'Destination'"
  [placeholder]="'Choose a destination'"
  [rootLabel]="'Destinations'"
/>

Value and events

Use one source of truth: [(value)]="destination" or [value]="destination()" with (valueChange)="destination.set($event)". Do not bind both forms at once.

Inputs configure the control. valueChange synchronizes its model; the other Outputs report their documented actions or lifecycle. Requests for suggestions, children or remote windows require the application to supply data.

Accessibility and keyboard

Use a visible label or an accessible name. Test keyboard navigation, disabled options, selection and closing the panel. Custom option templates should keep descriptive text and must not introduce a nested button or another focusable checkbox inside the option.

Key
Action
Tab Moves focus into or out of the control.
ArrowDown / ArrowUp Moves the active option through available options.
Enter Activates the focused option.
Escape Closes the panel without selecting another option.

API

The reference lists the public Inputs, models, Outputs and Templates from the pinned Core package. Click a named type to open its definition. Each applicable Template has an executable example and its actual source.

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
backAriaLabelstring'Back to previous level'[backAriaLabel]Accessible label for returning to the parent level.
breadcrumbAriaLabelstring'Cascade levels'[breadcrumbAriaLabel]Accessible name of the current ancestor path.
clearablebooleanfalse[clearable]Shows a clear action when a value is selected.
clearAriaLabelstring'Clear selection'[clearAriaLabel]Accessible name of the clear-selection button.
compareWith(left: V, right: V) => booleanObject.isDerived default[compareWith]Comparison function for selected values; use stable domain identity.
dirtybooleanfalse[dirty]Form state indicating that the user has changed the value.
disabledbooleanfalse[disabled]Disables user interaction; disabled options cannot be selected.
emptyLabelstring'No options found'[emptyLabel]Message displayed when there are no available options.
errorsreadonly ValidationError.WithOptionalFieldTree[][][errors]Validation errors supplied by the form or the application.
hiddenbooleanfalse[hidden]Hides the control according to the form state.
invalidbooleanfalse[invalid]Displays the invalid state; it does not add a validation rule.
labelstring''[label]Visible field or option label.
optionChildrenNeuOptionAccessor<T, readonly T[]> | nullnull[optionChildren]Field name or function that reads a node's children.
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.
optionsreadonly T[][][options]Loaded option records. Accessors allow using your own domain objects.
optionValue(option: T) => V(option) => resolveNeuOptionValue<T, V>(option)Derived default[optionValue]Field name or function used to obtain the stored option value.
pendingbooleanfalse[pending]Form state indicating that asynchronous validation is pending.
placeholderstring'Select...'[placeholder]Text shown when the field has no selected value.
readonlybooleanfalse[readonly]Keeps the value readable without allowing the user to change it.
requiredbooleanfalse[required]Marks the field as required; use a form validator to enforce it.
rootLabelstring'All options'[rootLabel]Label of the root navigation level.
touchedbooleanfalse[touched]Form state indicating that the control has been visited.

Models

A model supports [(property)]="signal" or the [property] and (propertyChange) pair. Choose one form, not both.

Name
Type
Default
Template binding
Description
valueV | nullnull[(value)]Selected leaf value or null; ancestors represent navigation rather than selection.

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
closedvoid(closed)="onClosed($event)"Emitted after the browser panel closes.
groupChangereadonly T[](groupChange)="onGroupChange($event)"Ancestor path selected by user navigation; restoring a value does not emit it.
openedvoid(opened)="onOpened($event)"Emitted after the browser panel opens.
optionActivatedNeuOptionActivatedEvent<T, V>(optionActivated)="onOptionActivated($event)"Activated option, its value and the originating event.
touchvoid(touch)="onTouch($event)"Notifies the form that the control has been touched; not a value change.

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
NeuCascadeSelectEmptyDirectiveView example Public template directive (entrypoint)ng-template[neuCascadeSelectEmpty]
NeuCascadeSelectFooterDirectiveView example Public template directive (entrypoint)ng-template[neuCascadeSelectFooter]
NeuCascadeSelectHeaderDirectiveView example Public template directive (entrypoint)ng-template[neuCascadeSelectHeader]
NeuCascadeSelectItemDirectiveView example Public template directive (entrypoint)ng-template[neuCascadeSelectItem]
NeuCascadeSelectSelectedDirectiveView example Public template directive (entrypoint)ng-template[neuCascadeSelectSelected]

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

Empty template

NeuCascadeSelectEmptyDirective

Empty template

Open the control to see the empty state.

Header template

NeuCascadeSelectHeaderDirective

Header template

Open the control to see the custom template.

Item template

NeuCascadeSelectItemDirective

Item template

Open the control to see the custom template.

Selected template

NeuCascadeSelectSelectedDirective

Selected template

Open the control to see the custom template.

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Load Core styles once. Use the public tokens below for local customization or a preset for application-wide changes. Keep labels, focus, selected options and disabled states readable in both light and dark themes.

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
--neu-border Normal control and cell borders Shared by other Core consumers; scope the override. rgba(15, 23, 42, 0.08)
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff
--neu-radius Control corner radius Shared by other Core consumers; scope the override. 8px
--neu-surface Main field, header or control surface Shared by other Core consumers; scope the override. #ffffff
--neu-text Main text and inherited icon color Shared by other Core consumers; scope the override. #0f172a
--neu-text-muted Secondary labels and supporting content Shared by other Core consumers; scope the override. #475569
--neu-border-subtle Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-border)
--neu-shadow-lg Surface or overlay elevation Shared by other Core consumers; scope the override. 0 10px 30px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.04)