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

Dock

Offer a compact action dock with application icons, link destinations and custom items.

Category
Actions
Import
@neural-ui/core/dock
Selector
neu-dock
import { NeuDockComponent } from '@neural-ui/core/dock';

Overview

Dock groups frequent actions into a compact bar. Pass an items array of NeuDockItem, each with a unique key and a label. Use command for an action, routerLink for an application route or url for a link. Icons are optional and resolved by your application; active marks the current destination.

position sets a horizontal bar for top/bottom and a vertical bar for left/right; it does not fix the dock to the viewport. magnification enlarges items on hover with a fine pointer. breakpoint switches to the compact mobile presentation.

Basic interaction

Activate Workspace, Documents or Search. Each item runs its command and emits itemClick; the counters below show both actions. Settings starts disabled. Open Code to see the item definitions and event handlers.

Basic interaction

Selected: โ€” ยท itemClick: 0 ยท Commands: 0

Configurator

Change the options, try the result and see the template update. Open Code for the complete data model and implementation.

Configurator

Selected: โ€” ยท itemClick: 0 ยท Commands: 0

Core options update this template. Item icons, badges and disabled actions belong to the data model shown in Code.

template.html
<neu-dock
  [items]="dockItems()"
  ariaLabel="Example navigation"
  position="bottom"
  direction="ltr"
  breakpoint="960px"
  [magnification]="true"
  (itemClick)="selectItem($event)"
/>

Data and content

itemClick reports activation after the item command. itemFocus and itemBlur report focus events. The application owns work, routing and active data; Core owns hover/focus presentation and keyboard navigation. neuDockItem replaces visible item content with item, active and index while retaining the owning link/button and accessible label.

Accessibility and keyboard

Name the dock. Tab reaches the active available item; arrows follow orientation/direction and Home/End reach the ends. Hidden/disabled actions are excluded from roving focus. Enter/Space activate commands; links retain their native navigation. Tooltip text is supplemental, not the only accessible label. Custom Templates should not add nested interactive controls.

Key
Action
Tab Enter the dock at the active available item or leave the group.
Arrow keys Move through available items according to orientation and text direction; disabled/hidden items are skipped.
Home Focus the first available item.
End Focus the last available item.
Enter Activate the focused command or follow its link.
Space Activate a focused command button; links retain native behaviour.

API

Inputs and Outputs match the installed package. Named types link to definitions. Each available Template/projection has an executable example.

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'Application dock'[ariaLabel]Accessible navigation/menu name. Use a label specific to this region.
ariaLabelledBystring | nullnull[ariaLabelledBy]Id of an existing element naming the navigation; takes precedence over ariaLabel.
breakpointstring'960px'[breakpoint]Viewport width threshold for compact mobile presentation, expressed as CSS pixels.
directionNeuTextDirection'ltr'[direction]Text/keyboard direction: ltr or rtl.
itemsNeuDockItem[][][items]Dock action data; provide command or a link destination plus optional icon, badge and active state.
magnificationbooleantrue[magnification]Enables fine-pointer hover magnification; coarse-pointer presentation remains compact.
positionNeuDockPosition'bottom'[position]Dock alignment/orientation: top, right, bottom or left. Application layout determines placement.

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
itemBlurFocusEvent(itemBlur)="onItemBlur($event)"Emits the FocusEvent when a dock action loses focus.
itemClickNeuDockItem(itemClick)="onItemClick($event)"Emits the activated leaf/action. The optional command runs first; disabled entries do not activate.
itemFocusFocusEvent(itemFocus)="onItemFocus($event)"Emits the FocusEvent when an available dock action receives focus.

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
NeuDockItemDirectiveView example Public template directive (entrypoint)ng-template[neuDockItem]

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

Custom dock items

NeuDockItemDirective

Custom dock items

Selected: โ€” ยท itemClick: 0 ยท Commands: 0

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Use supported public tokens for the component. Icon resolution and surrounding example layout belong to the application. Check both themes and narrow screens.

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-primary-soft Subtle selected or active surface Shared by other Core consumers; scope the override. var(--neu-primary-50)
--neu-surface Main field, header or control surface Shared by other Core consumers; scope the override. #ffffff
--neu-surface-2 Secondary surfaces and alternating rows Shared by other Core consumers; scope the override. #f1f5f9
--neu-text Main text and inherited icon color Shared by other Core consumers; scope the override. #0f172a
--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)