Timeline Item
<wa-timeline-item>
Timeline items represent a single entry inside a <wa-timeline>, such as one event in an order history or
activity feed.
This component must be used as a child of <wa-timeline>. Please see the Timeline docs to see examples of this component in action.
We received your order and will begin processing it shortly.
API
Importing
If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.
Import this component directly from the CDN:
import 'https://ka-f.webawesome.com/[email protected]/components/timeline-item/timeline-item.js';
After installing Web Awesome via npm, import this component:
import '@awesome.me/webawesome/dist/components/timeline-item/timeline-item.js';
If you're self-hosting Web Awesome, import this component from your server:
import './webawesome/dist/components/timeline-item/timeline-item.js';
To import this component for React 18 or below, use the following code:
import WaTimelineItem from '@awesome.me/webawesome/dist/react/timeline-item/index.js';
Slots
Learn more about using slots.
| Name | Description |
|---|---|
| (default) | The item's main content, such as a title and description. |
icon
|
An element, such as <wa-icon> or <wa-avatar>, shown inside the marker. Icons are drawn at 40% of the marker's size, and an avatar fills the marker. |
opposite
|
Optional content shown on the opposite side of the rail from the main content, commonly a date or timestamp, such as a <wa-format-date> or <wa-relative-time>. |
Attributes & Properties
Learn more about attributes and properties.
| Name | Description | Reflects |
|---|---|---|
variantvariant |
Colors the item's marker. Neutral items keep a quiet marker, so a variant stands out against them. The color is
cosmetic; pair it with an icon and a clear label when an entry needs to read as failed or flagged.
Type
'neutral' | 'brand' | 'success' | 'warning' | 'danger'
Default
'neutral'
|
|
withIconwith-icon |
Only required for SSR. Set to
true if you're slotting in an icon element, so the server-rendered markup sizes
the marker for it before the component hydrates on the client.
Type
boolean
Default
false
|
|
withOppositewith-opposite |
Only required for SSR. Set to
true if you're slotting in an opposite element, so the server-rendered markup
includes it before the component hydrates on the client.
Type
boolean
Default
false
|
CSS Custom Properties
Learn more about CSS custom properties.
| Name | Description |
|---|---|
--connector-gap |
The gap between this item's marker and its connector. Inherited from
<wa-timeline>; set it here to change it for one item. Use a length such as 0px, not a bare 0, to remove it. |
--icon-marker-size |
The size of the item's marker when its icon slot has content, such as an icon or avatar. Inherited from
<wa-timeline>, where it defaults to 2em; set it here to change it for one item. |
--marker-size |
The size of the item's marker when its icon slot is empty. Inherited from
<wa-timeline>, where it defaults to 1em; set it here to change it for one item. |
CSS Parts
Learn more about CSS parts.
| Name | Description | CSS selector |
|---|---|---|
connector |
The line connecting this item to its neighbors. Each item draws the half leading in and the half leading out, and both carry this part name. |
::part(connector)
|
content |
The wrapper around the default slot. |
::part(content)
|
marker |
The circular marker that marks the item's position on the timeline. |
::part(marker)
|
opposite |
The wrapper around the opposite slot. |
::part(opposite)
|
timeline-item |
The component's outer wrapper. |
::part(timeline-item)
|
SSR
Learn more about Server-Side Rendering (SSR).
If you slot content into opposite, set the with-opposite attribute, otherwise the opposite column won't render until the item hydrates on the client. Likewise, if you slot content into icon, set the with-icon attribute, otherwise the marker draws at its smaller default size until the item hydrates.