Skip to main content

Timeline

v.6.0.0

Installation

yarn add @mercell/timeline-react'

Usage

Using the Timeline component is as simple as importing it like this.

import { Timeline } from '@mercell/timeline-react';
Live Editor
Result

Types, definitions, etc.

TimelineProps
interface TimelineProps {
eventsOccurred?: number;
eventsTotal?: number;
} & JSX.IntrinsicElements['ul']
NameTypeDefaultRequiredDescription
eventsOccurrednumber-noScreen reader will have progress tag to give user info about events
eventsTotalnumber-noScreen reader will have progress tag to give user info about events
TimelineItemProps
interface TimelineEvent {
customIndicatorPosition?: 'right' | 'center';
customIndicator?: ReactNode;
lineClassName?: string;
indicatorWrapperClassName?: string;
textClassName?: string;
} & JSX.IntrinsicElements['li']
NameTypeDefaultRequiredDescription
customIndicatorPosition'right' | 'center''center'noPosition of custom indicator in regards to the line
customIndicatorReactNode-noCustom indicator - can be icon, text, etc.
lineClassNamestring-noClassName access to the line div
indicatorWrapperClassNamestring-noClassName access to the wrapper of indicator
textClassNamestring-noClassName access to the child (ReactNode)