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

Toolbar

Arrange application actions in responsive content regions.

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

Usage

Project content into start, center, end and secondary regions. Use wrap="wrap" when actions need to move onto additional lines on narrow screens. size controls dimensions, density adjusts spacing, and tone plus variant chooses the surface. Toolbar does not supply action handlers or arrow-key navigation.

Examples

Try the behavior and inspect the executable source in Code.

Examples
Orders
Ready to process
6 orders ยท Updated today

Exports: 0

Try and configure

Change the options, try the result and inspect its generated template. Open Code for the full implementation.

Try and configure
Orders
Ready to process

Exports: 0

template.html
<neu-toolbar
  size="md"
  density="normal"
  tone="neutral"
  variant="soft"
  wrap="wrap"
  [shadow]="false"
  [bordered]="false"
>
  <strong neu-toolbar-start>Orders</strong>
  <span neu-toolbar-center>Ready to process</span>
  <div neu-toolbar-end>
    <button
      neu-button
      size="sm"
      variant="solid"
      tone="brand"
      (neuClick)="count.update(increment)"
    >
      Export
    </button>
  </div>
</neu-toolbar>

Data and content

All seven Inputs configure layout and appearance. Toolbar has no Outputs; projected controls own their events. density uses compact, normal or relaxed, not the global data-neu-density vocabulary.

Accessibility and keyboard

Use native buttons and meaningful labels for the actions. Content follows ordinary Tab order. This layout does not implement an ARIA toolbar roving-focus pattern; avoid assigning that role without implementing its keyboard behavior.

Key
Action
Tab Follow the normal focus order of links, fields and actions inside the content; the container adds no roving-focus model.
Enter Activate a focused native button or follow a focused link inside the content.
Space Activate a focused native button inside the content; fields keep normal text editing.

API

Inputs and Outputs match the pinned Core package. Named types link to their definitions. Templates include executable examples for each supported region.

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
borderedbooleanfalse[bordered]Draw a bottom separator.
densityNeuDensity'normal'[density]Spatial density: compact, normal or relaxed.
shadowbooleanfalse[shadow]Add a subtle surface shadow.
sizeNeuToolbarSize'md'[size]Toolbar dimension scale: sm, md or lg.
toneNeuToolbarTone'neutral'[tone]Surface intent: neutral or brand.
variantNeuToolbarVariant'soft'[variant]Surface treatment: solid, soft or ghost.
wrapNeuToolbarWrap'nowrap'[wrap]nowrap keeps one line; wrap lets regions flow into additional lines.

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
[neu-toolbar-start]

Leading region

View example
Content projection

Place the title or leading actions.

<ng-content select="[neu-toolbar-start]" />

Context used: โ€”

[neu-toolbar-center]

Center region

View example
Content projection

Place context between the leading and trailing regions.

<ng-content select="[neu-toolbar-center]" />

Context used: โ€”

[neu-toolbar-end]

Trailing region

View example
Content projection

Place the primary application actions.

<ng-content select="[neu-toolbar-end]" />

Context used: โ€”

[neu-toolbar-secondary]

Secondary region

View example
Content projection

Use wrap="wrap" to place supporting content on another row.

<ng-content select="[neu-toolbar-secondary]" />

Context used: โ€”

*

Additional content

View example
Content projection

Project content outside the named regions.

<ng-content />

Context used: โ€”

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

start

[neu-toolbar-start]

start
Orders

center

[neu-toolbar-center]

center
6 results

end

[neu-toolbar-end]

end

Exports: 0

secondary

[neu-toolbar-secondary]

secondary
Updated today

Additional content

*

Additional content
Additional projected content

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Use public tokens for surfaces, text, spacing and focus. Test your content in both themes and at narrow widths.

Specific tokens

Token
Purpose
State / variant
Default / source
Fallback
--neu-toolbar-bg Inherited theme value used by this component Field surface var(--neu-surface-1)Root declaration--neu-surface-1
--neu-toolbar-color Inherited theme value used by this component Field surface var(--neu-text)Root declaration--neu-text
--neu-toolbar-primary-bg Inherited theme value used by this component Field surface var(--neu-primary-dark)Root declaration--neu-primary-dark
--neu-toolbar-primary-color Inherited theme value used by this component Field surface var(--neu-primary-fg)Root declaration--neu-primary-fg

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-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-primary-solid Solid brand action background Shared by other Core consumers; scope the override. #006ee6
--neu-primary-solid-fg Foreground of solid brand actions Shared by other Core consumers; scope the override. #ffffff
--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-border-color Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-border)
--neu-surface-1 Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-surface)