Timeline
Event timeline for status history
Usage
Timeline
Highlight recent updates.
Loading demo...
Best Practices
- Put the durable status in
titleor slot text; usecoloronly as a visual reinforcement. - Mark exactly one current event with
activein step-by-step flows. - Use
layout="horizontal"for short milestone sequences; keep audit logs and long histories vertical. - Keep
timeconcise and consistently formatted across items. - Use
iconsparingly. Dense timelines are more readable when only exceptional states get icons.
API Reference
Props
| Property | Type | Default | Description |
|---|---|---|---|
| layout | Layout direction |
TxTimelineItem Props
| Property | Type | Default | Description |
|---|---|---|---|
| title | - | Timeline item title | |
| time | - | Time label | |
| color | Dot color | ||
| icon | - | Dot icon | |
| active | Highlight the current event item |
Slots
| Component | Slot | Props | Description |
|---|---|---|---|
TxTimeline | default | - | Timeline items. |
TxTimelineItem | default | - | Optional event description rendered below the title/time row. |
Events
TxTimeline and TxTimelineItem do not emit events.
Admin Audit Flow
TxTimeline works well for authorization, release, sync, and other admin task event streams. Use active to highlight the current step and treat color as a semantic aid only; the important state should still be present in title or slot text.
Permission orchestration panel
A screenshot-verified authorization audit timeline.
Loading demo...
Overview
TxTimelineexposesrole="list"and eachTxTimelineItemexposesrole="listitem".activeapplies to both the item and dot, highlighting the current event.layout="horizontal"is provided to child items through context, switching the event stream to a horizontal layout.
Technologies
- Source:
packages/tuffex/packages/components/src/timeline/src/TxTimeline.vueconfirmsrole="list", vertical/horizontal layout class resolution, and context provided to child items. - Item source:
packages/tuffex/packages/components/src/timeline/src/TxTimelineItem.vueconfirmsrole="listitem", title/time/default-slot rendering, optional icon rendering, semantic dot color classes, active item/dot classes, and injected layout classes. - Type contracts:
packages/tuffex/packages/components/src/timeline/src/types.tsdefines layout and item color unions plus component prop contracts. - Verified coverage: Coverage:
packages/tuffex/packages/components/src/timeline/__tests__/timeline.test.tscovers list semantics, default vertical layout, horizontal layout injection, title/time/default slot/icon rendering, semantic color class, and active item/dot state. - Recommendation: mark the current event with
active; keepcolorwithin'default' | 'primary' | 'success' | 'warning' | 'error'and avoid undefined semantic tones.
查看源码
packages/tuffex/packages/components/src/timeline/index.ts