Skip to Content
Notion UI

Timeline

A timeline with draggable items, date ranges, and a sidebar.

Timeline Without Sidebar

Supported Features

  • Daily, monthly, and quarterly range views

  • Draggable and resizable timeline items

  • Auto-scroll to today's date on mount

  • Range navigation with previous/next jump buttons

  • "Today" indicator with tooltip

  • Optional sidebar with header and scrollable body

  • Marker creation via hover trigger

  • Deferred range transitions for smooth UI

Installation

pnpm add @notion-kit/ui

Anatomy

<TimelineProvider>
  <TimelineContent>
    <TimelineRangeHeader />
    <TimelineList>
      <TimelineRow.Root item={feature} onMove={handleMoveFeature}>
        <TimelineRow.Jump />
        <TimelineRow.Track>
          <TimelineRow.Resize direction="start" />
          <TimelineRow.Item>{feature.name}</TimelineRow.Item>
          <TimelineRow.Resize direction="end" />
        </TimelineRow.Track>
      </TimelineRow.Root>
    </TimelineList>
    <TimelineToolbar>
      <TimelineRangeSelect />
      <TimelineJumpTo />
    </TimelineToolbar>
    <TimelineToday />
  </TimelineContent>
  <TimelineSidebar>
    <TimelineSidebarHeader>
      <TimelineSidebarClose />
      {/* your header */}
    </TimelineSidebarHeader>
    <TimelineSidebarBody>
      {/* your body */}
    </TimelineSidebarBody>
  </TimelineSidebar>
</TimelineProvider>

Examples


Layout Only

A timeline with a range header, toolbar, and today indicator. No items are loaded.

Timeline Layout

<TimelineProvider range={range}>
  <TimelineContent>
    <TimelineRangeHeader />
    <TimelineToolbar>
      <TimelineRangeSelect value={range} onChange={setRange} />
      <TimelineJumpTo />
    </TimelineToolbar>
    <TimelineToday />
  </TimelineContent>
</TimelineProvider>

Without Sidebar

A full timeline with draggable items, context menus, range selection, and a marker creation trigger.

Timeline Without Sidebar

<TimelineProvider range={range}>
  <TimelineContent>
    <TimelineRangeHeader />
    <TimelineList>
      {features.map((feature) => (
        <TimelineRow.Root
          key={feature.id}
          item={feature}
          onMove={handleMoveFeature}
        >
          <TimelineRow.Jump />
          <TimelineRow.Track>
            <TimelineRow.Resize direction="start" />
            <TimelineRow.Item onClick={() => openFeature(feature.id)}>
              {feature.name}
            </TimelineRow.Item>
            <TimelineRow.Resize direction="end" />
          </TimelineRow.Track>
        </TimelineRow.Root>
      ))}
    </TimelineList>
    <TimelineToolbar>
      <TimelineRangeSelect value={range} onChange={setRange} />
      <TimelineJumpTo />
    </TimelineToolbar>
    <TimelineToday />
  </TimelineContent>
</TimelineProvider>

With Sidebar

A timeline with an attached sidebar panel listing all items, plus a header toolbar for opening/closing the sidebar.

Timeline With Sidebar

<TimelineProvider range={range}>
  <TimelineContent>
    <TimelineRangeHeader />
    <TimelineList>
      {features.map((feature) => (
        <TimelineRow.Root
          key={feature.id}
          item={feature}
          onMove={handleMoveFeature}
        >
          <TimelineRow.Jump />
          <TimelineRow.Track>
            <TimelineRow.Resize direction="start" />
            <TimelineRow.Item>{feature.name}</TimelineRow.Item>
            <TimelineRow.Resize direction="end" />
          </TimelineRow.Track>
        </TimelineRow.Root>
      ))}
    </TimelineList>
    <TimelineToday />
    <TimelineHeaderToolbar />
  </TimelineContent>
  <TimelineSidebar>
    <TimelineSidebarHeader>
      <TimelineSidebarClose />
    </TimelineSidebarHeader>
    <TimelineSidebarBody>
      {features.map((feature) => (
        <div key={feature.id}>{feature.name}</div>
      ))}
    </TimelineSidebarBody>
  </TimelineSidebar>
</TimelineProvider>

Controlled navigation

Pass anchorDate and onAnchorDateChange to keep the currently viewed date outside the timeline, or use defaultAnchorDate for an initial position. The timestamp describes the center of the viewport after the sidebar width is removed. Scroll updates are reported before a layout can unmount; they can be stored separately from persisted view settings.

timeZone controls date boundaries and labels. Invalid zones fall back to UTC. startDate and endDate still bound the timeline data. An anchor outside the scrollable range is clamped and its actual visible date is reported.

API Reference

TimelineProvider

Root provider that manages timeline state, scroll position, and CSS variables.

Prop

Type

TimelineContent

The main scrollable container that holds the range header, items, and tools.

TimelineList

The absolutely-positioned list container for timeline rows, placed below the range header.

TimelineRangeHeader

Renders the two-row header showing range labels (years/quarters) and sub-range labels (months/weeks/days). No additional props.

TimelineRow.Root

Owns one row's drag state and provides it to the compound parts. Omit onMove and the resize parts for a click-only row.

Prop

Type

TimelineRow.Jump

Renders the off-screen navigation target used by Timeline jump controls. It reads the feature from TimelineRow.Root and takes no props.

TimelineRow.Track

Positions the item bar within one timeline row. Accepts standard <div> props.

TimelineRow.Item

Renders the full clickable card button and becomes the drag source when its root has onMove. Accepts standard button props, including onClick and children.

TimelineRow.Resize

Renders one draggable range edge. It is omitted automatically when the root has no onMove.

Prop

Type

TimelineToolbar

A sticky toolbar container for placing controls like range select and jump-to.

TimelineHeaderToolbar

A pre-composed toolbar with sidebar trigger, range select, and jump-to buttons.

Prop

Type

TimelineRangeSelect

A select dropdown for switching between range granularities.

Prop

Type

TimelineJumpTo

Navigation buttons for jumping to the previous/next range group and back to today.

TimelineToday

Renders a vertical red line and badge at today's date position.

GanttCreateMarkerTrigger

A hover-activated trigger that follows the cursor and creates a marker on click.

Prop

Type

TimelineSidebar

A sticky sidebar panel attached to the start edge of the timeline.

TimelineSidebarHeader

A sticky header inside the sidebar.

TimelineSidebarBody

A scrollable body area inside the sidebar.

TimelineSidebarClose

A button that hides the sidebar panel.

Prop

Type

TimelineSidebarTrigger

A button that opens the sidebar panel.

Prop

Type

type TimelineRange

type TimelineRange = "daily" | "monthly" | "quarterly";

type TimelineFeature

Prop

Type

On this page