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

Timeline

Present chronological events with semantic markers and custom content.

Category
Layout and content
Import
@neural-ui/core/timeline
Selector
neu-timeline
import { NeuTimelineComponent } from '@neural-ui/core/timeline';

Usage

Provide items with stable ids, a title and optional time, description, tone and SVG path icon. align positions the axis left, right or alternating; reverse changes visual order without mutating the input. density changes spacing. Use the item Template to replace the whole content area or the marker Template to replace only the dot content.

Examples

Try the behavior and open Code for the implementation.

Examples
  1. Order received09:00

    We have received your order.

  2. Ready for delivery10:30

    Your order has been packed.

  3. Delivered12:00

    The delivery has been completed.

Use stable item ids when the event collection changes.

Try and configure

Change the options and try the result. The generated template follows your configuration; Code contains the complete executable source.

Try and configure
  1. Order received09:00

    We have received your order.

  2. Ready for delivery10:30

    Your order has been packed.

  3. Delivered12:00

    The delivery has been completed.

template.html
<neu-timeline
  [items]="items()"
  align="left"
  density="normal"
  [reverse]="false"
  ariaLabel="Order history"
/>

Data and content

Timeline has no Outputs and does not edit or sort your collection. reverse only changes the rendered order. Template index is the zero-based visual position after reverse. icon is SVG path data, not an icon-provider key.

Accessibility and keyboard

Timeline renders an ordered list with an optional ariaLabel. Put meaningful event text in the content; markers must not be the only way to identify a status. Decorative SVG markers are hidden from assistive technology. Interactive content inside a Template uses its own native 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 package. Named types link to their definitions; each supported Template 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
alignNeuTimelineAlign'left'[align]Axis placement: left, right or alternate.
ariaLabelstring''[ariaLabel]Accessible name of the event list.
densityNeuDensity'normal'[density]Spatial scale: compact, normal or relaxed.
itemsreadonly NeuTimelineItem[][][items]Chronological events with stable optional ids and text.
reversebooleanfalse[reverse]Reverse rendered order without mutating items.

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
NeuTimelineItemDirective

Event content

View example
Public template directive (entrypoint)

Use let-event to access the event. The item Template also receives let-index="index" in visual order.

ng-template[neuTimelineItem]

Context used: $implicit: item, index: number

NeuTimelineMarkerDirective

Event marker

View example
Public template directive (entrypoint)

Use let-event to access the event. The item Template also receives let-index="index" in visual order.

ng-template[neuTimelineMarker]

Context used: $implicit: item

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

Event content

NeuTimelineItemDirective

Event content
  1. 1. Order received

    We have received your order.

    09:00
  2. 2. Ready for delivery

    Your order has been packed.

    10:30
  3. 3. Delivered

    The delivery has been completed.

    12:00

Marker

NeuTimelineMarkerDirective

Marker
  1. Order received09:00

    We have received your order.

  2. Ready for delivery10:30

    Your order has been packed.

  3. Delivered12:00

    The delivery has been completed.

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Use public tokens for spacing, surface, text and focus. Check projected content and controls in both themes and at narrow widths.

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-error Invalid field or danger-action color Shared by other Core consumers; scope the override. #dc2626
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff
--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-text-disabled Text of disabled controls Shared by other Core consumers; scope the override. #64748b
--neu-text-muted Secondary labels and supporting content Shared by other Core consumers; scope the override. #475569