Skip to content

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
2024-01-01
Event 1: Project Initiation
2024-02-15
Event 2: Requirements Analysis Completed
2024-03-20
Event 3: Development Phase Started
2024-04-30
Event 4: Testing Phase
展开代码

Custom Node Color ​

Custom Node Color
Use the color prop to customize the timeline node color
2024-01-01
Success Event
Project successfully launched, all resources ready
2024-02-15
Warning Event
Requirements changed, need to re-estimate timeline
2024-03-20
Error Event
Major technical issue discovered during development
2024-04-30
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
📅2024-01-01 09:00

Project Kickoff Meeting

Discuss project goals, timeline, and resource allocation

✅2024-02-15 14:30

Requirements Analysis Complete

All functional requirements confirmed, moving to design phase

🚧2024-03-20 10:00

Development Phase Begins

Frontend and backend development underway

展开代码

Custom Styling ​

Custom Styling
Use the style prop to customize the timeline container's appearance
Phase 1

Concept Design

Define product direction and core features

Phase 2

Prototype Development

Create interactive product prototype

Phase 3

Product Testing

Conduct user testing and feature validation

Phase 4

Official Launch

Product goes live with support

展开代码

API Reference ​

Timeline Props ​

PropDescriptionTypeOptionsDefault
directionTimeline directionstringvertical/horizontalvertical
styleCustom stylesStyleValue—{}

TimelineItem Props ​

PropDescriptionTypeOptionsDefault
timestampTimestamp contentstring——
colorNode colorstringHex or named color—

TimelineItem Slots ​

Slot NameDescriptionParameters
defaultTimeline item content—
timestampTimestamp content—

Type Definitions ​

typescript
interface TimelineProps {
  direction?: 'vertical' | 'horizontal';
  style?: StyleValue;
}

interface TimelineItemProps {
  timestamp: string;
  color?: string;
}

Released under the MIT License.