Timeline
Vertical display timeline. Used to visually display chronological events or a series of steps.
Timeline
- 2024-09-01Create a services siteNetwork problems being solved
- 2024-09-02Solve initial network problemsTechnical testing
- 2024-09-05Technical testingNetwork problems being solved
astro
---
import Timeline from '@/components/data-display/Timeline.astro';
import TimelineItem from '@/components/data-display/TimelineItem.astro';
---
<Timeline>
<TimelineItem title="Create a services site" time="2024-09-01" status="success">
Network problems being solved
</TimelineItem>
<TimelineItem title="Solve initial network problems" time="2024-09-02" status="process">
Technical testing
</TimelineItem>
<TimelineItem title="Technical testing" time="2024-09-05" status="default">
Network problems being solved
</TimelineItem>
</Timeline> Timeline
TimelineItems support different sizes (sm, md, lg), custom icons (via the icon prop), and statuses (default, primary, success, error, warning, process).
- 09:00 AMAccount createdWelcome to the platform.
- 09:30 AMProfile updatedUser updated their avatar.
- 10:15 AMPayment failedTransaction declined by the bank.
- 10:20 AMRetrying payment...Waiting for user to update payment method.
- ProcessingSystem is processing the new request.
astro
---
import Timeline from '@/components/data-display/Timeline.astro';
import TimelineItem from '@/components/data-display/TimelineItem.astro';
---
<Timeline>
<TimelineItem title="Account created" time="09:00 AM" status="success" size="lg" icon="Check">
Welcome to the platform.
</TimelineItem>
<TimelineItem title="Profile updated" time="09:30 AM" status="primary" size="md" icon="User">
User updated their avatar.
</TimelineItem>
<TimelineItem title="Payment failed" time="10:15 AM" status="error" size="md" icon="X">
Transaction declined by the bank.
</TimelineItem>
<TimelineItem title="Retrying payment..." time="10:20 AM" status="warning" size="md" icon="TriangleAlert">
Waiting for user to update payment method.
</TimelineItem>
<TimelineItem title="Processing" status="process">
System is processing the new request.
</TimelineItem>
</Timeline> Timeline
You can fully customize the content of a timeline item by using default slots for the body, or the dot slot for the timeline node itself.
- 1 week agoRelease v1.2.0
- Added Timeline component
- Improved contrast in dark mode
- Fixed modal positioning
- 2 weeks agoCode Review
Pending review from @johndoe
astro
---
import Timeline from '@/components/data-display/Timeline.astro';
import TimelineItem from '@/components/data-display/TimelineItem.astro';
---
<Timeline>
<TimelineItem title="Release v1.2.0" time="1 week ago" status="primary">
<div class="p-3 bg-zinc-50 dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded-md mt-2">
<ul class="list-disc pl-4 text-sm text-zinc-600 dark:text-zinc-400">
<li>Added Timeline component</li>
<li>Improved contrast in dark mode</li>
<li>Fixed modal positioning</li>
</ul>
</div>
</TimelineItem>
<TimelineItem title="Code Review" time="2 weeks ago">
<!-- Custom dot -->
<div slot="dot" class="w-3 h-3 bg-purple-500 rounded-full animate-pulse"></div>
<p class="text-sm mt-1">Pending review from @johndoe</p>
</TimelineItem>
</Timeline> API Reference
Timeline
| Property | Description | Type | Default |
|---|---|---|---|
| align | Timeline alignment | 'left' | 'right' | 'alternate' | 'left' |
TimelineItem
| Property | Description | Type | Default |
|---|---|---|---|
| status | Visual state/color of the timeline node | 'default' | 'primary' | 'success' | 'error' | 'process' | 'warning' | 'default' |
| size | Size of the timeline node | 'sm' | 'md' | 'lg' | 'sm' |
| title | Timeline | string | '-' |
| time | Time or date text | string | '-' |
| icon | Name of the icon to display inside the node | IconName | '-' |