Skip to content

Timeline

Chronological event timeline display for Ink 5. Shows events with timestamps, type badges, and descriptions — ideal for deploy history, incident logs, audit trails.

Install

Terminal window
npm install @matthesketh/ink-timeline

Usage

import React from 'react';
import { render } from 'ink';
import { Timeline } from '@matthesketh/ink-timeline';
const events = [
{ time: '10:00', title: 'Deployed v1.2.3', type: 'deploy' },
{ time: '10:15', title: 'Service restarted', type: 'restart' },
{ time: '10:30', title: 'CPU spike detected', type: 'alert', description: 'CPU usage above 90%' },
];
render(<Timeline events={events} />);

Props

PropTypeDefaultDescription
eventsTimelineEvent[]requiredArray of events to display
maxVisiblenumberundefinedLimit visible events with scroll indicators
showRelativeTimebooleanfalseShow “2m ago” style timestamps

TimelineEvent

FieldTypeDescription
timestring | DateDisplayed timestamp
typestringBadge label (e.g. deploy, restart, alert)
typeColorstringOverride badge colour
titlestringEvent title
descriptionstringDetail shown below title

Auto-colours

TypeColour
deploygreen
restartyellow
alertred
errorred
infoblue

License

MIT