Back to Ant Design

Timeline

components/timeline/index.en-US.md

6.3.73.6 KB
Original Source

When To Use

  • When a series of information needs to be ordered by time (ascending or descending).
  • When you need a timeline to make a visual connection.

Examples

<!-- prettier-ignore -->

<code src="./demo/basic.tsx">Basic</code> <code src="./demo/variant.tsx">Variant</code> <code src="./demo/pending.tsx">Loading and Reversing</code> <code src="./demo/pending-legacy.tsx" debug>Pending and Reversing</code> <code src="./demo/alternate.tsx">Alternate</code> <code src="./demo/horizontal.tsx">Horizontal</code> <code src="./demo/horizontal-debug.tsx" debug>Horizontal</code> <code src="./demo/custom.tsx">Custom</code> <code src="./demo/end.tsx">End alternate</code> <code src="./demo/title.tsx">Title</code> <code src="./demo/title-span.tsx">Title Offset</code> <code src="./demo/semantic.tsx">Semantic Sample</code> <code src="./demo/style-class.tsx" version="6.0.0">Custom semantic dom styling</code> <code src="./demo/component-token.tsx" debug>Component Token</code>

API

Common props ref:Common props

Timeline

PropertyDescriptionTypeDefaultVersion
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-
itemsEach node of timelineItems[]-
modeBy sending alternate the timeline will distribute the nodes to the left and rightstart | alternate | endstart
orientationSet the direction of the timelinevertical | horizontalvertical
pendingSet the last ghost node's existence or its content. Use item.loading insteadReactNodefalse
pendingDotSet the dot of the last ghost node when pending is true. Use item.icon insteadReactNode<LoadingOutlined />
reverseWhether reverse nodes or notbooleanfalse
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-
titleSpanSet the title span space. It is the distance to the center of the dot <InlinePopover previewURL="https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*1NJISa7bpqgAAAAAR5AAAAgAerJ8AQ/original"></InlinePopover>number | string12
variantConfig style variantfilled | outlinedoutlined

Items

Node of timeline.

PropertyDescriptionTypeDefault
colorSet the circle's color to blue, red, green, gray or other custom colorsstringblue
contentSet the contentReactNode-
childrenSet the content. Please use content insteadReactNode-
dotCustomize timeline dot. Please use icon insteadReactNode-
iconCustomize node iconReactNode-
labelSet the label. Please use title insteadReactNode-
loadingSet loading statebooleanfalse
placementCustomize node placementstart | end-
positionCustomize node position. Please use placement insteadstart | end-
titleSet the titleReactNode-

Semantic DOM

Timeline

<code src="./demo/_semantic.tsx" simplify="true"></code>

Timeline Items

<code src="./demo/_semantic_items.tsx" simplify="true"></code>

Design Token

<ComponentTokenTable component="Timeline"></ComponentTokenTable>