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

TimelineGrid

Arrange activities across named rows and time columns with controlled selection.

Category
Data and hierarchy
Import
@neural-ui/core/timeline-grid
Selector
neu-timeline-grid
import { NeuTimelineGridComponent } from '@neural-ui/core/timeline-grid';

Usage

Define columns with stable ids, labels and optional descriptions. Each row supplies its items; start identifies a column id and span extends across consecutive columns. The grid clamps spans to the available columns and ignores items with an unknown start. Use tone, subtitle and meta to describe activities. minColumnWidth preserves readable columns and the schedule scrolls locally on narrow screens.

Examples

Try the interaction and open Code for the complete implementation.

Examples

Select an item or an available slot. On narrow screens, scroll this schedule horizontally to see every day.

Monday
Tuesday
Wednesday
DesignProduct team
Engineering

Selected item: โ€” ยท Selected slot: โ€” / โ€”

Try and configure

Change the options, try the result and see the template update. Code contains the full executable example.

Try and configure

Select an item or an available slot. On narrow screens, scroll this schedule horizontally to see every day.

Monday
Tuesday
Wednesday
DesignProduct team
Engineering

Selected item: โ€” ยท Selected slot: โ€” / โ€”

Template generated from your current options. Open Code for the complete example.

template.html
<neu-timeline-grid
  [columns]="columns"
  [rows]="rows"
  density="normal"
  minColumnWidth="112px"
  [stickyLabels]="true"
  [selectedItemId]="selectedItemId()"
  [selectedSlot]="selectedSlot()"
  (itemClick)="chooseItem($event)"
  (slotClick)="chooseSlot($event)"
/>
rows.ts
import type { NeuTimelineGridRow } from '@neural-ui/core/timeline-grid';

const rows: readonly NeuTimelineGridRow[] = [
  {
    "id": "design",
    "label": "Design",
    "description": "Product team",
    "items": [
      {
        "id": "research",
        "title": "Research",
        "start": "mon",
        "span": 2,
        "tone": "info",
        "subtitle": "Interviews"
      }
    ]
  },
  {
    "id": "engineering",
    "label": "Engineering",
    "items": [
      {
        "id": "review",
        "title": "Review",
        "start": "tue",
        "tone": "success"
      },
      {
        "id": "release",
        "title": "Release",
        "start": "wed",
        "tone": "warning"
      }
    ]
  }
];

Data and content

itemClick and slotClick report activation; they do not apply selection automatically. Update selectedItemId or selectedSlot to show the selection your application accepts. Clear the other value for mutually exclusive item/slot selection. This component displays data; it does not implement dragging or editing. It has no Templates.

Accessibility and keyboard

Items and slots are native buttons named from their row and content. Use Tab to reach them and Enter or Space to activate them. Applied selections expose aria-pressed. The scroll viewport is keyboard focusable; stickyLabels keeps row names visible while scrolling.

Key
Action
Tab Reach the scroll viewport and the enabled item/slot buttons.
Enter Activate the focused item or slot; applied selection controls aria-pressed.
Space Activate the focused item or slot; applied selection controls aria-pressed.

API

Inputs and Outputs match the installed package. Named types link to definitions. Every available Template has a Demo and Code 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
columnsreadonly NeuTimelineGridColumn[][][columns]Ordered stable column ids, labels and descriptions.
densityNeuDensity'normal'[density]Row spacing: compact, normal or relaxed.
minColumnWidthstring'112px'[minColumnWidth]Minimum column width as a CSS dimension.
rowsreadonly NeuTimelineGridRow[][][rows]Named rows containing items that reference column ids.
selectedItemIdstring | nullnull[selectedItemId]Applied activity id; null means none.
selectedSlotNeuTimelineGridSlotSelection | nullnull[selectedSlot]Applied rowId/columnId pair; null means none.
stickyLabelsbooleantrue[stickyLabels]Keep row labels visible during horizontal scrolling.

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
itemClickNeuTimelineGridItem(itemClick)="onItemClick($event)"Reports the activated activity object.
slotClickNeuTimelineGridSlotSelection(slotClick)="onSlotClick($event)"Reports the activated rowId/columnId pair.

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.

This component does not expose content projection or public customization templates.

Public Types

Open a type to inspect its definition and interface fields.

Styles and tokens

Customize supported public tokens and check both themes. Example illustrations and application state are not Core inputs.

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-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-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-muted Secondary labels and supporting content Shared by other Core consumers; scope the override. #475569