Timeline

Timeline visualizes a series of chained events.


import { Timeline } from 'primereact/timeline';
         

Alignment content.

Left Align
Ordered
Processing
Shipped
Delivered
Right Align
Ordered
Processing
Shipped
Delivered
Alternate Align
Ordered
Processing
Shipped
Delivered

<h5>Left Align</h5>
<Timeline value={events} content={(item) => item.status} />

<h5>Right Align</h5>
<Timeline value={events} align="right" content={(item) => item.status} />

<h5>Alternate Align</h5>
<Timeline value={events} align="alternate" content={(item) => item.status} />
         

Opposite Connect content.

Ordered
15/10/2020 10:30
Processing
15/10/2020 14:00
Shipped
15/10/2020 16:15
Delivered
16/10/2020 10:00

<Timeline value={events} opposite={(item) => item.status} content={(item) => <small className="p-text-secondary">{item.date}</small>} />
         

Customized content.

Customized
Ordered
15/10/2020 10:30

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!

Processing
15/10/2020 14:00

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!

Shipped
15/10/2020 16:15

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!

Delivered
16/10/2020 10:00

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore sed consequuntur error repudiandae numquam deserunt quisquam repellat libero asperiores earum nam nobis, culpa ratione quam perferendis esse, cupiditate neque quas!


<Timeline value={events} align="alternate" className="customized-timeline" marker={customizedMarker} content={customizedContent} />
         

Horizontal Connect content.

Top Align
2020
2021
2022
2023
Bottom Align
2020
2021
2022
2023
Alternate Align
 
2020
 
2021
 
2022
 
2023

<h6>Top Align</h6>
<Timeline value={events} layout="horizontal" align="top" content={(item) => item} />
<h6>Bottom Align</h6>
<Timeline value={events} layout="horizontal" align="bottom" content={(item) => item} />
<h6>Alternate Align</h6>
<Timeline value={events} layout="horizontal" align="alternate" content={(item) => item} opposite={<span>&nbsp;</span>} />
         

Following is the list of structural style classes, for theming classes visit theming page.

NameElement
p-timelineContainer element.
p-timeline-leftContainer element when alignment is left.
p-timeline-rightContainer element when alignment is right.
p-timeline-topContainer element when alignment is top.
p-timeline-bottomContainer element when alignment is bottom.
p-timeline-alternateContainer element when alignment is alternating.
p-timeline-verticalContainer element of a vertical timeline.
p-timeline-horizontalContainer element of a horizontal timeline.
p-timeline-eventEvent element.
p-timeline-event-oppositeOpposite of an event content.
p-timeline-event-contentEvent content.
p-timeline-event-separatorSeparator element of an event.
p-timeline-event-markerMarker element of an event.
p-timeline-event-connectorConnector element of an event.
Accessibility guide documents the specification of this component based on WCAG guidelines, the implementation is in progress.

Screen Reader

Timeline uses a semantic ordered list element to list the events. No specific role is enforced, still you may use any aria role and attributes as any valid attribute is passed to the list element.

Keyboard Support

Component does not include any interactive elements.

Visit the API documentation for detailed information about all the properties, events and methods of the component.