Timeline Component
Axiom01's timeline component provides a visually engaging way to display a series of events in chronological order. It's ideal for showcasing historical data, project milestones, or user activity feeds.
Live Example
Event Title 1
January 1, 2023
Description of the first event, providing context and details about what happened at this point in time.
Event Title 2
February 15, 2023
The second event in the series, with more information about its significance and impact.
Event Title 3
March 30, 2023
The final event shown in this example, concluding the timeline demonstration.
HTML Structure
The timeline component is built using a main container with individual timeline items, each containing a marker and content.
<div class="timeline">
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>Event Title 1</h3>
<p class="timeline-date">January 1, 2023</p>
<p>Description of the first event...</p>
</div>
</div>
<div class="timeline-item">
<div class="timeline-marker"></div>
<div class="timeline-content">
<h3>Event Title 2</h3>
<p class="timeline-date">February 15, 2023</p>
<p>The second event in the series...</p>
</div>
</div>
</div>
Styling
The .timeline class sets up the main layout, typically using relative positioning to allow for absolute positioning of markers and lines. Each .timeline-item contains a .timeline-marker (the visual point on the line) and .timeline-content (the event details).
.timeline: Main container for the entire timeline..timeline-item: Container for each event, often using flexbox for alignment..timeline-marker: The visual indicator for an event, typically a circle or icon..timeline-content: Contains the event title, date, and description.
JavaScript Integration
The timeline component is primarily CSS-driven for its layout and appearance. JavaScript can be used for:
- Dynamically loading more timeline items (e.g., infinite scroll).
- Filtering or sorting timeline events.
- Adding interactive elements within timeline content.
Accessibility
Ensure the timeline is accessible:
- Use semantic headings (
<h3>) for event titles. - Provide clear and concise text for event descriptions and dates.
- If the timeline is interactive, ensure keyboard navigation is supported.
Customization
Customize the appearance using Axiom01's CSS variables for colors, spacing, and typography. You can adjust the size and color of markers, the timeline line, and the layout of content within each item.