PanelMenu
An inline Accordion + Tree hierarchy with deterministic Signal expansion, deep keyboard navigation and complete visual ownership.
GET STARTED
Import
Import the canonical standalone component. Legacy Component-suffixed exports remain compatibility aliases.
import { NeuralPanelMenu, type NeuralPanelMenuEntry } from '@neural-ng/core/panel-menu';
@Component({ imports: [NeuralPanelMenu] })Data-driven hierarchy
Stable keys control expansion without mutating the immutable source array. Leaves emit selection; branches emit toggle state.
No interaction yet.
Angular RouterLink
Use routerLink for SPA navigation without a document reload. Query params, fragments, history behavior and navigation state use Angular Router's normal contract; href remains available for native and external links.
Multiple roots and deep branches
multiple keeps several root panels open. Nested branches preserve their independent state.
Projected composition
Use item and separator components when the hierarchy belongs directly in the template.
Disabled and link states
Disabled branches and leaves stay perceivable but cannot toggle or emit. Leaf entries may render native anchors through href, target and rel.
Unstyled and typed classes
Headless mode retains tree semantics, focus, expansion and animation structure while Tailwind owns every visible choice.
Component boundary
PanelMenu is always inline. Menu owns flat command lists, while Drawer owns an edge-based layout container that may contain a PanelMenu.
ACCESSIBILITY
Native tree interaction
The hierarchy follows tree, treeitem and group semantics with roving tabindex and deterministic relationships.
Tree semantics
Branches expose aria-expanded and aria-controls. Levels use aria-level, collapsed groups are inert, and disabled entries expose aria-disabled.
Keyboard behavior
Up/Down traverses visible items, Right expands or enters, Left collapses or returns, Home/End reaches boundaries, Enter/Space activates, and typing performs typeahead.
Focus and reduced motion
Focus returns to a deterministic visible item. Animation durations collapse under prefers-reduced-motion without removing state changes.
API
Public contract
Data, projected composition, state models and semantic events share one typed contract.
Inputs and models
| Name | Type | Default | Purpose |
|---|---|---|---|
| items | readonly NeuralPanelMenuEntry[] | [] | Immutable data-driven hierarchy. |
| expandedKeys | model<readonly string[]> | [] | Stable keys of expanded branches. |
| multiple | boolean | false | Allows several root branches to remain expanded. |
| disabled | boolean | false | Disables the complete hierarchy. |
| panelMenuId | string | generated | Stable root ID used by item and group relationships. |
| ariaLabel | string | null | null | Accessible tree name. |
| ariaLabelledby | string | null | null | ID of an external accessible label. |
| unstyled | boolean | false | Removes NeuralNg visual classes. |
| panelMenuClass | string | '' | Additive class on the tree root. |
| classes | NeuralPanelMenuClasses | {} | Typed additive classes for internal slots. |
Events
expandedKeysChangereadonly string[]Implicit model output after expansion changes.
itemSelectNeuralPanelMenuSelectEnabled leaf activation with pointer/keyboard source.
itemToggleNeuralPanelMenuToggleBranch state change with previous and next key sets.
Entry model
NeuralPanelMenuAction supports key, label, iconClass, badge, shortcut, disabled, href, routerLink and its Router options, target, rel, itemClass and recursive items. A separator uses { separator: true }.
Typed class slots
rootTree root.
listTop-level item collection.
itemContainerItem and optional child-group wrapper.
itemNative button or anchor.
expandedItemExpanded branch state.
disabledItemDisabled item state.
iconLeading Neural icon.
labelItem text.
metaBadge, shortcut and indicator wrapper.
badgeOptional count or status.
shortcutOptional keyboard hint.
indicatorBranch disclosure indicator.
groupAnimated child group.
groupInnerOverflow-clipping group interior.
separatorSemantic separator.
DESIGN TOKENS
PanelMenu tokens
Every variable is derived from the shipped Neutral theme and actual component CSS.
--neural-panel-menu-widthComponent inline size.
--neural-panel-menu-paddingComponent internal spacing.
--neural-panel-menu-colorComponent foreground color.
--neural-panel-menu-backgroundComponent background surface.
--neural-panel-menu-borderComponent border shorthand.
--neural-panel-menu-radiusComponent corner radius.
--neural-panel-menu-shadowComponent box shadow.
--neural-panel-menu-list-gapSpacing between list items.
--neural-panel-menu-item-gapSpacing between item items.
--neural-panel-menu-item-min-heightItem minimum block size.
--neural-panel-menu-item-padding-blockLogical block-axis padding inside each PanelMenu item.
--neural-panel-menu-item-padding-inlineBase logical inline-axis padding inside each PanelMenu item.
--neural-panel-menu-level-indentAdditional logical inline indentation applied for each nested PanelMenu level.
--neural-panel-menu-item-colorItem foreground color.
--neural-panel-menu-item-backgroundItem background surface.
--neural-panel-menu-item-color-hoverHovered item foreground color.
--neural-panel-menu-item-background-hoverHovered item background surface.
--neural-panel-menu-item-color-expandedExpanded item foreground color.
--neural-panel-menu-item-background-expandedExpanded item background surface.
--neural-panel-menu-item-radiusItem corner radius.
--neural-panel-menu-item-font-sizeItem font size.
--neural-panel-menu-item-font-weightItem font weight.
--neural-panel-menu-item-line-heightItem line height.
--neural-panel-menu-item-transitionItem CSS transition.
--neural-panel-menu-disabled-opacityDisabled opacity.
--neural-panel-menu-focus-ringComponent keyboard focus ring.
--neural-panel-menu-focus-ring-offsetComponent focus ring offset.
--neural-panel-menu-icon-colorIcon foreground color.
--neural-panel-menu-icon-sizeIcon width and height.
--neural-panel-menu-meta-gapSpacing between meta items.
--neural-panel-menu-meta-colorMeta foreground color.
--neural-panel-menu-badge-min-widthBadge minimum inline size.
--neural-panel-menu-badge-paddingBadge internal spacing.
--neural-panel-menu-badge-colorBadge foreground color.
--neural-panel-menu-badge-backgroundBadge background surface.
--neural-panel-menu-badge-radiusBadge corner radius.
--neural-panel-menu-badge-font-sizeBadge font size.
--neural-panel-menu-shortcut-colorShortcut foreground color.
--neural-panel-menu-shortcut-font-sizeShortcut font size.
--neural-panel-menu-indicator-sizeIndicator width and height.
--neural-panel-menu-indicator-durationIndicator animation duration.
--neural-panel-menu-indicator-easingIndicator animation easing curve.
--neural-panel-menu-group-durationGroup animation duration.
--neural-panel-menu-group-easingGroup animation easing curve.
--neural-panel-menu-separator-marginSeparator outer spacing.
--neural-panel-menu-separator-colorSeparator foreground color.