Lane Documentation

A Lane groups and positions articles within a defined area of the timeline. Use it to configure multi-lane layouts, tune lane behaviour and styling, and manage lanes through the API.

Lane Schema new

A lane object defines one horizontal section of a multi-lane timeline. Load articles with timeline.load and add a lane key to place them in a lane.

At a glance: Required fields — id. All other fields are optional.

Lane layout controls lane chrome. Article options control article placement. See Lane Article Overrides for the supported article keys.

Schema
// LaneData schema (clickable)
{
  id: /* required: number|string */,
  title: /* optional: string */,
  visibility: /* optional: 'visible' | 'hidden' | function(Lane): 'visible' | 'hidden' */,
  className: /* optional: string */,
  headerClassName: /* optional: string */,
  bodyClassName: /* optional: string */,
  titleClassName: /* optional: string */,
  layout: { /* See: Lane Layout */ },
  style: { /* See: Lane Style */ },
  article: { /* See: Lane Article Overrides */ }
}

Lane Options new

Configure multi-lane timelines where related articles sit in separate horizontal lanes while sharing one bottom axis.

These options live under options.lane.*. The values shown below are the defaults.

Lane layout controls lane chrome. Article options control article placement. See Lane Article Overrides for the subset of article options supported by each lane's article object. For a minimal runnable setup, see the simple timeline lanes CodePen.

JavaScript
// Lane options (defaults)
{
  visible: true,
  defaultId: 'default',
  gap: 12,
  topGap: 0,
  axisGap: 24,
  defaultLayout: {/* See: Lane Layout */ },
  defaultStyle: {/* See: Lane Style */ },
  defaultClassName: '',
  defaultHeaderClassName: '',
  defaultBodyClassName: '',
  defaultTitleClassName: '',
  data: [
    /* see Lane Schema; each lane can include
       article: { ... } - see Lane Article Overrides */
  ]
};

Lane Article Overrides

Set LaneData.article to override the timeline-wide article defaults from options.article for one lane. It supports a focused subset of Article Options; each value merges over the timeline article options for articles in that lane.

Use the Article Options section for the full descriptions and value shapes. The links below point to the matching option descriptions.

Merge order

Timeline article options apply first. Lane article overrides apply next for that lane, then individual article data and article-level style overrides apply last.

Supported keys

Other article keys, including cardLayoutBreakpoints, rendering, animation, star, periodLine.position, periodLine.stacking, and autoStacking.range, remain timeline-wide options.

Lane Layout new

Configure the reusable geometry shape for lane chrome. These fields are used by lane.defaultLayout and LaneData.layout.

Lane layout controls lane chrome height and title placement. Article options still control article placement inside each lane.

JavaScript
// LaneLayout options
{
  // height: 240, // optional fixed lane height in px
  heightWeight: 1,
  header: {
    visible: true,
    height: 24,
    padding: {
      left: 12,
      right: 12
    }
  }
};

Fixed and automatic heights: lanes with height consume fixed pixels first. Lanes without height divide the remaining lane area by heightWeight, excluding hidden lanes.

Lane Style new

Customize the DOM chrome for lane headers, bodies, and titles. These fields are used by lane.defaultStyle and LaneData.style.

Lane style defaults are empty objects, so inline styles are only written for values you explicitly configure.

Lane DOM also has stylesheet hooks for themes that should stay out of inline configuration: histropedia-lane, histropedia-lane-index-N, histropedia-lane-position-top, histropedia-lane-position-middle, histropedia-lane-position-bottom, histropedia-lane-header, histropedia-lane-title, and histropedia-lane-body.

N follows timeline.lanes from the shared axis outward. Lower lanes are given higher z-index values than lanes above them, so CSS shadows can make upper lanes appear tucked behind the lane below.

JavaScript
// LaneStyle options
{
  header: {
    // backgroundColor: 'rgba(219, 234, 254, 0.35)'
  },
  body: {
    // backgroundColor: 'rgba(219, 234, 254, 0.2)',
    // borderColor: 'rgba(30, 58, 138, 0.25)',
    // borderWidth: 1,
    // borderRadius: 4
  },
  title: {
    // color: '#1e3a8a',
    // font: '600 13px Inter, sans-serif',
    // textAlign: 'left'
  }
};

Per-lane overrides: set the style key in Lane data, call lane.setStyle, or provide global defaults with options.lane.defaultStyle. Fields you omit stay stylesheet-controlled.

.histropedia-lane {
  overflow: visible;
}

.histropedia-lane:not(.histropedia-lane-position-top) {
  box-shadow: 0 -14px 22px -20px rgba(15, 23, 42, 0.7);
}

.histropedia-lane-position-bottom {
  box-shadow: none;
}

Lane Methods new

Manage lane data, styles, visibility, and order after your timeline is initialized.

Tip: Loaded lanes are stored as Lane instances in timeline.lanes. Retrieve one with timeline.getLaneById(id) before calling the instance methods below.

.setOption(option, value?)

Configuration

Update lane data fields using objects or dot-notation paths.

Parameters

option string | object

Full lane object for batch updates, or a dot-notation path such as 'layout.heightWeight'.

value any

New value when using a string path. Omit this argument to read the current value.

Returns

any when called as a getter; otherwise void.

const lane = timeline.getLaneById('people');

lane.setOption({
  title: 'People & biographies',
  article: {
    defaultCardLayout: 'landscape',
    defaultStyle: { width: 220 }
  }
});

const layout = lane.setOption('layout');

.setStyle(option, value?)

Styling

Override lane chrome styling or query a style value.

Parameters

option string | object

Partial style object or dot-notation path such as 'title.color'.

value any

New value when using a string path. Omit to read the current override.

Returns

any when reading; otherwise void.

const lane = timeline.getLaneById('projects');

lane.setStyle('title.color', '#155e75');
lane.setStyle({
  body: {
    backgroundColor: 'rgba(207, 250, 254, 0.35)',
    borderColor: 'rgba(14, 116, 144, 0.35)'
  }
});

.hide() / .show()

Visibility

Hide or show a lane without unloading its data.

Returns

void – Updates visibility and redraws the timeline.

Hidden lanes are excluded from lane layout and hide their articles while lane layout is active.

const lane = timeline.getLaneById('reference');

lane.hide();
lane.show();

.moveToIndex(index) / .moveUp() / .moveDown()

Ordering

Reorder lanes by public lane index, where 0 is nearest the shared axis.

Parameters

index number

Target public lane index for moveToIndex. Out-of-range values are clamped.

Returns

Lane – The lane that was moved.

const peopleLane = timeline.getLaneById('people');

peopleLane.moveToIndex(0);
peopleLane.moveUp();
peopleLane.moveDown();

.moveBefore(targetLane) / .moveAfter(targetLane)

Ordering

Move a lane relative to another lane instance or lane id.

Parameters

targetLane Lane | string | number

Lane instance or lane id to move before or after.

Returns

Lane – The lane that was moved.

const projectsLane = timeline.getLaneById('projects');

projectsLane.moveBefore('people');
projectsLane.moveAfter('reference');

Need More Help?

If you can't find what you're looking for, browse the examples or contact us.