Timeline
A Timeline lists events over a period of time.
- To track an issue over time
- To show events associated with an item
- To guide users through a step by step process, use a Stepper instead
How to use it
Default
The Timeline component is made up of individual Timeline items. Item content appears after the item marker by default.
- Planted seedToday 9:00 AM
- Purchased seedFeb 08, 9:05 AM
- Arranged layout of gardenJan 21, 9:13 AM
- Chose a gardening locationJan 21, 9:21 AM
Alternating
Items are displayed on alternating sides of the Timeline.
- Planted seedToday 9:00 AM
- Purchased seedFeb 08, 9:05 AM
- Arranged layout of gardenJan 21, 9:13 AM
- Chose a gardening locationJan 21, 9:21 AM
Custom media
The item marker can also be replaced with another icon, image, or avatar.
- Planted seedToday 9:00 AM
- Purchased seedFeb 08, 9:05 AM
- Arranged layout of gardenJan 21, 9:13 AM
- Chose a gardening locationJan 21, 9:21 AM
Opposite content
In the opposite layout, a second content area is present on the opposite side of the Timeline.
- Today 9:00 AMPlanted seed
- Feb 08, 9:05 AMPurchased seed
- Jan 21, 9:13 AMArranged layout of garden
- Jan 21, 9:21 AMChose a gardening location
How to use it well
Nest content when necessary
Components such as links, buttons, and images can be nested in each Timeline item.
![](/static/2ccd40beaed1d6987d22c5d3fd3f3cec/c21ad/components-timeline-nesting-do.png)
Do include images and other nested content if appropriate.
Make interactive elements explicit
Creating a visual affordance for a link or action is preferred to making the entire item interactive.
![](/static/0c58d7fdbb29620d6dc280340e9a0dcd/b0f70/components-timeline-interactive-elements-do.png)
Create explicit visual affordances for interactive items.
![](/static/345a3c0cc1d6d94fa16bda2f0b01dac2/b0f70/components-timeline-interactive-elements-dont.png)
Don’t rely on hover states to show that items are interactive.
Use correct hierarchy
Item content can be replaced with any text style. Make sure to use appropriate hierarchy when designing your content.
![](/static/fa945b2a7494fdf2ae12120b957ead71/b0f70/components-timeline-correct-hierarchy-do.png)
Use balanced and appropriate typographic hierarchy.
![](/static/8a35716b702124f5ffed2e62fdd8b75a/b0f70/components-timeline-correct-hierarchy-dont.png)
Don’t mix up typographic hierarchy when customizing item content.
Configuration
- Name9.5.1•View source•View on npm
- Installnpm install @zendeskgarden/react-accordions
- Depsnpm install react react-dom styled-components @zendeskgarden/react-theming
- Importimport { Timeline } from '@zendeskgarden/react-accordions'
API
The Timeline component follows this structure:
<Timeline>
<Timeline.Item>
<Timeline.OppositeContent /> {/* Optional */}
<Timeline.Content />
</Timeline.Item>
{/* other items */}
</Timeline>
Timeline
Extends OlHTMLAttributes<HTMLOListElement>
Prop name | Type | Default | Description |
---|---|---|---|
isAlternate | boolean | Applies alternate styling |
Timeline.Content
Extends HTMLAttributes<HTMLDivElement>
Nest the Content within an Item component.
Timeline.Item
Extends LiHTMLAttributes<HTMLLIElement>
An Item provides the DOM structure and styling for the default, OppositeContent, and alternate content layouts.
Prop name | Type | Default | Description |
---|---|---|---|
icon | ReactElement<any, string | JSXElementConstructor<any>> | Replaces the dot with an icon | |
surfaceColor | string | Provides surface color for an icon placed on a non-default background. Accepts a color variable key (i.e. |
Timeline.OppositeContent
Extends HTMLAttributes<HTMLDivElement>
The OppositeContent component displays content on the opposite side of the separator. Nest it within an Item component.