Ant Design Svelte

Timeline

Event history with directions, times, loading, icons and theme settings.

When to use

Timeline shows the history of related events and the order in which they occur: delivery, project changes, or process log. It does not control the passage of stages; for an interactive multi-step task, use Steps.

Events and story order

items contains title, content and an optional persistent key. color sets the color of the node, icon — its own icon. loading marks a wait event; reverse reverses the visual order while preserving the application's original data.

Problem Setting Example
Show sequence items Main story
Indicate expectation item.loading, reverse Loading and order
Alternate sides mode="alternate" Alternation
Separate time from content title, content Signatures
Set horizontal axis orientation="horizontal" Horizontal placement
Add event action snippet in content Own node

The loading label does not load the data itself. The application adds or updates the corresponding item after the result of the operation. Events should have a text state: a single color or spinning icon does not explain what happened.

Axis, sides and header space

orientation selects vertical/horizontal. Mode:start/end/alternate determines the side of events relative to the line; a separate item can specify placement:start/end. Logical sides follow the direction of the interface.

titleSpan specifies the space to the center of the node. Number is the fraction of the 24-column grid, line is the CSS length, including percentages. With alternate, the numeric titleSpan is not applied. For a long horizontal story, keep the scrolling local, as in the example, without expanding the entire page.

Variant:outlined/filled changes the design of nodes. Icon accepts text content or a snippet; native buttons inside content retain their own semantics and keyboard. Timeline does not sort entries by date: prepare the desired order of items in advance.

Semantic DOM and theme

Root - ol with elements of history. Content may include links, times and actions; Use clear signatures and times where machine-readable times are important to your application.

Throughout the Timeline semantic, names are prefixed with item: itemTitle/itemContent/itemRail. A single event uses title/content/rail. Item classNames/styles specify general settings. styles contains CSS strings; semantic example shows both levels.

Timeline design tokens are applied via theme.components.Timeline and change the line, nodes and padding. The topic can be updated independently of the event array; bind:nativeElement provides the root ol after mount. This design does not automatically filter or paginate the story.

ConfigProvider.timeline accepts TimelineConfig: class, style, classNames and styles; data and behavior remain props of the Timeline. Semantic defaults support callback of current props. The classes add up; for root, provider styles.root, provider style, local styles.root, local style are used. For events, local styles and item styles take precedence over general ones. The nested timeline={} replaces the entire record Timeline. Example settings shows these levels.

A separate ConfigProvider.steps passes only the root class/style to the Timeline: the semantic settings of Steps do not style Timeline events. Resetting timeline={} does not disable steps.class/style; this also requires steps={}.

Local prefixCls changes the namespace of the root, states, and Timeline nodes. A non-empty local prefix takes precedence; empty string and undefined inherit ConfigProvider.prefixCls with the -timeline suffix, defaulting to ant-timeline. The internal Steps separately inherits the same base prefix with the -steps suffix: the local Timeline.prefixCls does not affect it. Therefore, suite and Timeline.prefixCls="local-history" give local-history along with suite-steps, and without setting the provider, ant-steps is saved. theme and semantic API are not renamed. Local prefix and common prefix switch without changing history.

Examples

  1. Project created
  2. Tests completed
  3. Version published

Basic example

Events by time and node colors.

outlined

  1. Preparation
  2. Check
  3. Ready

filled

  1. Preparation
  2. Check
  3. Ready

Unit options

outlined and filled.

  1. Assembly completed
  2. Checks passed
  3. Publication…

Loading and reverse order

Control item.loading and reverse.

  1. Creating a project
  2. Code check
  3. Package assembly
  4. Publication

Alternation of events

start, alternate and end.

  1. 09:00
    Creation
  2. 10:00
    Check
  3. 12:00
    Publication

Horizontal history

Scrolling within the card.

  1. 09:00
    Processing started
  2. 09:30
  3. Awaiting decision
  4. Archive preparation
Confirmed: 0

Icon and action

Snippet icon and button in content.

  1. Project created
  2. Tests completed
  3. Check required
  4. Release prepared

End edge

Events on the other side of the line.

  1. 09:00
    Project created
  2. 09:30
    Check completed
  3. Preparing files
  4. 12:00
    Version published

Time labels

The title is separate from the content.

100px

  1. 05:10
    Preparation
  2. 09:03
    Check
  3. Assembly
  4. 11:28
    Publication

25%

  1. 05:10
    Preparation
  2. 09:03
    Check
  3. Assembly
  4. 11:28
    Publication

18 columns, end

  1. 05:10
    Preparation
  2. 09:03
    Check
  3. Assembly
  4. 11:28
    Publication

Header indent

Pixels, percentages and columns.

  1. 09:00
    General style
  2. 10:00
    Single Event Style
  1. Coordination
  2. Publication

Semantic DOM

Object, function and styles of a single event.

  1. 09:00
    Preparation
  2. 10:00
    Check
  3. 11:00
    Ready

Component tokens

Six local Timeline tokens.

  1. 09:00
    Preparation
  2. 10:00
    Publication

Right to left

direction and time labels.

  1. 09:10
    Order created
  2. 09:15
    Payment confirmed
  3. 10:30
    Transferred for delivery
  4. Delivery expected

Order history from review

reverse and loading state of the last event.

  1. 09:00
    Application received
  2. 10:00
    Application verified
  1. 09:00
    Application received
  2. 10:00
    Application verified
  1. 09:00
    Application received
  2. 10:00
    Application verified

General Timeline Settings

Priority of provider, local and item styles; isolation from semantic Steps settings.

  1. 09:00
    Creating a project
  2. 10:00
    Project publication
  1. 09:00
    Creating a project
  2. 10:00
    Project publication

Local CSS prefix

Own namespace Timeline while maintaining the internal Steps classes.

API

Verified against 11 ant.design 6.7.0 themes and public types of the installed Svelte package. variant outlined/filled has already been published. Full definitions of Props are in the library.

Example themes
ThemeExample or limitation
BasicSequence of events and colors.
Variantoutlined and filled from the current page 6.7.
Loading and Reversingitem.loading and reverse order.
Alternatestart, alternate and end.
HorizontalHorizontal story with local scrolling.
CustomIcon and action as Snippet.
End alternateAlign to end edge.
TitleTime is separate from content.
Title Offset100px, 25% and number columns.
Semantic SampleGeneral styles and individual event styles.
Custom semantic dom stylingObject and function with props.
Component configConfigProvider.timeline and Steps settings boundary.
Local CSS prefixNamespace Timeline with preservation of internal Steps classes.

Timeline

PropertyDescriptionTypeDefault
prefixClsFull local Timeline CSS prefix. The empty string inherits the common prefix; ant-timeline is used without configuration. The inner Steps separately inherits ConfigProvider.prefixCls, independent of the local Timeline.prefixCls.stringConfigProvider + -timeline
itemsEvents with stable key, title, content and icon.readonly TimelineItem[][]
modePlacement of events relative to the line: start, alternate or end.start | alternate | endstart
orientationTime line direction.vertical | horizontalvertical
variantDesign of nodes. Supported by the public Svelte API.outlined | filledoutlined
titleSpanNumber of columns out of 24 or CSS length: for example 100px or 25%.number | string12
reverseReverse visual order of events.booleanfalse
stylesCSS lines root and item slots; object or function.TimelineSlots | callbackConfigProvider.timeline
classNamesSemantic slots classes.TimelineSlots | callbackConfigProvider.timeline

TimelineItem

PropertyDescriptionTypeDefault
titleTime label or title; supports Snippet.TimelineContent—
contentText or Snippet with event content.TimelineContent—
iconAn icon instead of a regular node.TimelineContentcircle
loadingIndicator of an unfinished event.booleanfalse
placementPosition of a specific event.start | endby mode
colorPreset or custom CSS node color.stringblue
stylesLocal root/wrapper/icon/section/header/title/content/rail.StepsItemSlots—

ReactNode is replaced with values ​​and Snippet, CSSProperties with CSS strings. Events use title/content/icon/placement; item.loading specifies the pending state.

ConfigProvider.timeline accepts TimelineConfig: class, style, classNames and styles. Semantic defaults support an object or callback with the current props. Local styles take precedence; nested timeline={} replaces the entire record. Item styles take priority. Only the root class/style is inherited from ConfigProvider.steps; semantic Steps settings are isolated.

Semantic DOM

Timeline displays ol with li. Common slots use the item prefix; individual event styles - short names title/content/rail. The decorative icon is hidden from the accessibility tree; the button inside content is accessible from the keyboard.

Timeline
SlotPurpose
rootOrdered list.
itemEvent.
itemWrapperEvent wrapper.
itemIconNode icon.
itemSectionEvent area.
itemHeaderHeader area.
itemTitleTitle or time.
itemContentContents.
itemRailConnecting line.

Registration tokens

theme.components.Timeline specifies the line, size and background of the node, and the distance between events. In the example, all six tokens are changed. Inline styles clarify local design.

TokenPurpose
tailColorLine color.
tailWidthLine thickness.
dotBorderWidthThickness of the node outline.
dotSizeKnot size.
dotBgNode background.
itemPaddingBottomInterval between events.
Common tokens of the current topic
TokenMeaning
colorPrimary#2f54eb
colorError#ff4d4f
colorSuccess#52c41a
colorTextrgba(0,0,0,0.88)
colorTextDisabledrgba(0,0,0,0.25)
fontSize14
lineHeight1.5714285714285714
paddingXS8

FAQ

How to show waiting?

Pass loading to the desired event. The addition and removal of this event is controlled by the application.

How to place a button in an event?

Pass snippet to content and use a native button. Its handlers remain part of the application.

What is the difference between Event and Timeline styles?

General slots are called itemTitle/itemContent/itemRail, local slots are called title/content/rail. Local values ​​clarify the general ones.

What does titleSpan mean?

Number is the fraction of the 24-column grid, line is the CSS length. In alternate, the numeric value is not used.