Timeline
Brief Introduction
The Timeline component is used to display a chronological sequence of events. You can use <MYTimeline></MYTimeline> and <MYTimelineItem></MYTimelineItem> to implement a timeline component.
Basic Timeline
Basic Timeline
Vertical timeline, default direction is vertical
Event 1: Project Initiation
Event 2: Requirements Analysis Completed
Event 3: Development Phase Started
Event 4: Testing Phase
展开代码
Custom Node Color
Custom Node Color
Use the color prop to customize the timeline node color
Success Event
Project successfully launched, all resources ready
Warning Event
Requirements changed, need to re-estimate timeline
Error Event
Major technical issue discovered during development
Info Event
Testing completed, ready for launch
展开代码
Custom Content Using Slots
Custom Content Using Slots
Use the timestamp slot to customize timestamp display and the default slot for content
Project Kickoff Meeting
Discuss project goals, timeline, and resource allocation
Requirements Analysis Complete
All functional requirements confirmed, moving to design phase
Development Phase Begins
Frontend and backend development underway
展开代码
Custom Styling
Custom Styling
Use the style prop to customize the timeline container's appearance
Concept Design
Define product direction and core features
Prototype Development
Create interactive product prototype
Product Testing
Conduct user testing and feature validation
Official Launch
Product goes live with support
展开代码
API Reference
Timeline Props
| Prop | Description | Type | Options | Default |
|---|---|---|---|---|
| direction | Timeline direction | string | vertical/horizontal | vertical |
| style | Custom styles | StyleValue | — | {} |
TimelineItem Props
| Prop | Description | Type | Options | Default |
|---|---|---|---|---|
| timestamp | Timestamp content | string | — | — |
| color | Node color | string | Hex or named color | — |
TimelineItem Slots
| Slot Name | Description | Parameters |
|---|---|---|
| default | Timeline item content | — |
| timestamp | Timestamp content | — |
Type Definitions
typescript
interface TimelineProps {
direction?: 'vertical' | 'horizontal';
style?: StyleValue;
}
interface TimelineItemProps {
timestamp: string;
color?: string;
}