Command palette

@yasinsensoy/web

Web · Components

Timeline

Shows events or steps in chronological order on a line: activity feed, order/shipment tracking, change history, roadmap, process steps.

14 exports

Live example

Preview

Today

  1. Ayşe Yılmaz released version 2.4.0
    The release notes were sent to everyone on the team.
  2. Mehmet Kaya left a comment
    “The back button closes the Dialog on mobile, great!”
    I tried it on a real device; it behaves the same on iOS and Android. Could we look at the Sheet too?
  3. Build failed
    tests/e2e/dialog.spec.ts › 3 tests

Yesterday

  1. Zeynep Demir joined the project
  2. 12 components, 3 new icons

Thursday, October 22

  1. Project created

Code

import { Timeline } from "@yasinsensoy/web";

<Timeline groupBy="day" collapsible
  items={[
    { title: "Order received", time: "2026-10-28T10:12", status: "done", icon: "check" },
    { title: "Out for delivery", description: "The courier will deliver today.", status: "active" },
    { title: "Delivered", status: "pending" },
  ]}
/>

Events

  1. Events appear here when you interact with the preview.

Order tracking: icon markers, statuses

  1. Order received (Done)
  2. Payment confirmed (Done)
  3. Shipped (Done)
    Aras Kargo · Tracking no. 1234 5678 90
  4. Out for delivery (Current step)
    The courier will deliver by 18:00 today.
  5. Delivered (Pending)

Horizontal steps (marker=number), the current step is centered

  1. Account (Done)
    Email and password
  2. Profile (Done)
    Name, photo
  3. Team (Current step)
    Invite your friends
  4. Payment (Pending)
    Pick a plan
  5. Done (Pending)

Roadmap: cards spread to both sides

  1. October 2026
    Infrastructure (Done)
    Monorepo, theme, utilities.
  2. November 2026
    Core components (Done)
    Form, overlays, navigation.
  3. December 2026
    Data components (Current step)
    DataGrid, TreeView, Chart, Timeline.
    DataGridTreeViewTimeline
  4. January 2027
    AI skill and 1.0 (Pending)
    Catalog refresh, stable release.

Change history: times on the left (timePosition=opposite)

Today

  1. Ayşe Yılmaz released version 2.4.0
    The release notes were sent to everyone on the team.
  2. Mehmet Kaya left a comment
    “The back button closes the Dialog on mobile, great!”
    I tried it on a real device; it behaves the same on iOS and Android. Could we look at the Sheet too?
  3. Build failed
    tests/e2e/dialog.spec.ts › 3 tests

Yesterday

  1. Zeynep Demir joined the project
  2. 12 components, 3 new icons

Thursday, October 22

  1. Project created

Chat-like feed: the side is fixed with side, opposite content

  1. Customer
    Support ticket opened
  2. Support
    Ticket taken into review
  3. More info requested
    Could you share the order number?
  4. Order no: #7012
  5. Resolved (Done)

Long feed: maxVisible={3}, placeholders at the end (loading)

  1. Ayşe Yılmaz released version 2.4.0
    The release notes were sent to everyone on the team.
  2. Mehmet Kaya left a comment
    “The back button closes the Dialog on mobile, great!”
    I tried it on a real device; it behaves the same on iOS and Android. Could we look at the Sheet too?
  3. Build failed
    tests/e2e/dialog.spec.ts › 3 tests
Show 3 more

Ongoing process: a dashed tail after the last item (line), empty state

  1. Draft (Done)
  2. In review (Current step)
No activity on this order yet.

Import

import { Timeline } from "@yasinsensoy/web";

Timeline

componentServer component

Shows events or steps in chronological order on a line: activity feed, order/shipment tracking, change history, roadmap, process steps. Entries are given with the items array.

  • It is a server component: Used directly in Next.js pages; date formatting, grouping and sorting happen on the server, no JavaScript is sent to the client. Expand/collapse works with native <details>.
  • Layout: Vertical or horizontal; content on one side of the line or alternating on both (align="alternate"). The time next to the title, above it or on the opposite side of the line (timePosition).
  • Markers: Dot, icon, index number or a fully custom element (avatar). Color with tone, done / current / pending with status.
  • Grouping: With groupBy="day", headings like "Today", "Yesterday", "Tuesday, October 28"; month, year or your own key. Headings can be sticky and collapsible.
  • Long lists: "Show N more entries" with maxVisible; details collapse with collapsible; placeholders with loading.
  • Mobile: An alternating or opposite-column timeline switches to a single column on small screens; a horizontal timeline scrolls by finger and the current step is centered. All done with CSS; no measuring.
  • Accessibility: An ordered list (<ol>); time is <time dateTime>, the state is read as text to screen readers, the current step gets aria-current="step". Flips automatically in right-to-left languages.
Timeline({ items: rawItems, orientation, align, timePosition: timePositionProp, marker, variant: variantProp, effect, size, groupBy, groupLabel, stickyGroups, collapsibleGroups, sort, timeFormat, locale: localeProp, timeZone, now: nowProp, collapsible, maxVisible, loading, empty, responsive, oppositeWidth, itemWidth, headingLevel, labels: labelsProp, classNames, className, style, ...props }: TimelineProps<T>): JSX.Element

Examples

// Activity feed grouped by day:
<Timeline
  groupBy="day"
  sort="desc"
  timeFormat="relative"
  items={events.map((e) => ({
    id: e.id,
    title: e.title,
    description: e.user,
    time: e.date,
    icon: e.icon,
  }))}
/>

// Order tracking:
<Timeline
  marker="icon"
  items={[
    { title: "Order received", time: "2026-10-28T10:12", status: "done" },
    { title: "Preparing", time: "2026-10-29T09:00", status: "done" },
    { title: "Shipped", description: "UPS · 1234567", status: "active" },
    { title: "Delivered", status: "pending" },
  ]}
/>

// Alternating roadmap with cards:
<Timeline align="alternate" variant="card" items={roadmap} />

// Horizontal steps:
<Timeline orientation="horizontal" marker="number" items={steps} />

Values accepted as dates: Date, an ISO string or milliseconds.

type TimelineDate = Date | string | number

Interval by which items are grouped.

  • "day": by day ("Today", "Yesterday", "Monday, October 12, 2026").
  • "month": by month ("October 2026").
  • "year": by year ("2026").
  • Function: returns the item's group key (e.g. (item) => item.project). The key itself is shown as the title; change it with groupLabel.
type TimelineGroupBy = "day" | "month" | "year" | ((item: T) => string)

Date format: Intl options or "relative" (relative: "3 hours ago").

type TimelineTimeFormat = Intl.DateTimeFormatOptions | "relative"

Progress state of an entry (step-by-step processes, order tracking):

  • "done": Completed. The marker is filled with color, the next line is colored.
  • "active": The current step. The marker is a ring and pulses; it gets aria-current="step" and is scrolled into view in a horizontal timeline.
  • "pending": Not reached yet. The marker is empty, the line dashed, the text faded.

If omitted, the entry is just an event (activity feed, change history).

type TimelineStatus = "done" | "active" | "pending"

Look of the entries: plain or carded.

type TimelineVariant = "plain" | "card"

Style of the connector line after the entry. "none" removes the line.

type TimelineLine = "solid" | "dashed" | "dotted" | "none"

TimelineItem

interface

An entry in the Timeline items array.

NameTypeDefaultDescription
id?string | numberUnique key. If omitted, its index is used.
titleReactNodeTitle.
description?ReactNodeShort description below the title. Always visible, even in a collapsible entry.
content?ReactNodeDetail content (text, image, card, list…). Shown when a collapsible entry opens.
time?TimelineDateDate of the entry: Date, ISO text or milliseconds. Grouping and sorting use it.
timeLabel?ReactNodeTime text to show. If given, it replaces the formatted time (e.g. "Tomorrow, 14:00", "Week 2"); time is still used for grouping, sorting and <time dateTime>.
opposite?ReactNodeContent on the opposite side of the line (e.g. amount, person, duration). If given, it is shown on the opposite side instead of the time; the time moves next to the title.
icon?IconPropIcon inside the marker: name ("check") or element.
marker?ReactNodeThe marker itself entirely (e.g. <Avatar size="sm" />). If given, it is drawn instead of the dot and icon.
tone?ToneColor of the marker. If omitted, "primary" when status is set, otherwise "neutral". "danger", "warning", "success" also bring their own icon on an icon marker.
status?TimelineStatusProgress state. See TimelineStatus.
href?stringLink of the title. Internal addresses are rendered with the link component given to UIProvider (Next.js Link).
actions?ReactNodeActions at the end of the title row (e.g. a menu button).
collapsible?booleanWhether content toggles when the title is clicked. If omitted, the timeline's collapsible prop applies.
defaultOpen?booleanfalseWhether a collapsible entry starts open.
line?TimelineLineStyle of the line after this entry. If omitted it is solid; dashed if the entry or the next one is "pending". If given on the last entry, the line continues downward with a short tail ("ongoing").
side?"start" | "end"Fixes the entry's side in an align="alternate" timeline: "start" after the line (on the right in left-to-right languages), "end" before it. Used in chat-like feeds (incoming/outgoing).
tooltip?TooltipPropTooltip shown when hovering the marker. See TooltipProp.
className?stringClasses added to the entry's container (<li>).

Placement of the content relative to the line:

  • "start": The line first, content after it (line on the left in left-to-right languages). Horizontally the content is below the line.
  • "end": The line last, content before it. Horizontally the content is above the line.
  • "alternate": The line in the middle, entries alternate on both sides.
type TimelineAlign = "start" | "end" | "alternate"

Position of the time:

  • "end": At the end of the title row, small and faded.
  • "top": Above the title.
  • "opposite": On the opposite side of the line (e.g. times on the left, events on the right).
type TimelineTimePosition = "end" | "top" | "opposite"

Default style of markers (the entry's icon and marker always take precedence):

  • "dot": A small dot.
  • "icon": An icon in a circle; for entries without an icon a check or tone icon by state, otherwise a small dot.
  • "number": The index in a circle; a check mark on completed steps.
type TimelineMarker = "dot" | "icon" | "number"

Texts of Timeline. Defaults come from the dictionary's ui texts (timelineEmpty, loading, timelineDone…) in a client tree, Turkish on the server; the labels prop overrides them.

NameTypeDescription
emptystringWhen there are no entries. Defaults to the UIProvider text ("Henüz kayıt yok" in Turkish).
loadingstringRead to screen readers while loading. Defaults to the UIProvider text ("Yükleniyor" in Turkish).
donestringScreen reader text of the "done" status. Defaults to the UIProvider text ("Tamamlandı" in Turkish).
activestringScreen reader text of the "active" status. Defaults to the UIProvider text ("Şu anki adım" in Turkish).
pendingstringScreen reader text of the "pending" status. Defaults to the UIProvider text ("Bekliyor" in Turkish).
showMorestringButton revealing hidden entries; {count} is the number of hidden entries. Defaults to the UIProvider text ("{count} kayıt daha göster" in Turkish).
showLessstringButton hiding the revealed entries again. Defaults to the UIProvider text ("Daha az göster" in Turkish).
groupCountstringEntry count in a collapsible group heading; {count}. Defaults to the UIProvider text ("{count} kayıt" in Turkish).

Classes that can be passed to the inner parts of Timeline.

NameTypeDescription
item?stringEach entry (<li>).
marker?stringMarker (dot, icon circle).
line?stringConnector line.
body?stringContent column of the entry (a card if variant="card").
title?stringTitle.
description?stringDescription.
content?stringDetail content.
time?stringTime text.
opposite?stringColumn on the opposite side.
groupHeader?stringGroup heading row.

TimelineProps

interface

Props of the Timeline component.

Extends: Omit<ComponentProps<"div">, "children">

NameTypeDefaultDescription
itemsreadonly T[]Entries. Drawn in the given order; to sort by date use sort.
orientation?"vertical" | "horizontal""vertical"Direction. A horizontal timeline scrolls sideways if it doesn't fit.
align?TimelineAlign"start"Position of the content relative to the line. See TimelineAlign.
timePosition?TimelineTimePosition"end"` vertically; `"opposite"` with `align="alternate"` or horizontally.Position of the time. See TimelineTimePosition.
marker?TimelineMarker"dot"Default style of markers. See TimelineMarker.
variant?TimelineVariant | CustomVariant<"timeline">"plain"Look. "card" shows each entry's content in a bordered card (for activity feeds and alternating timelines). Classes of a custom style added with defineAppearance are added to each entry's content column (laid out like plain unless extends is given). If omitted, UIProvider appearance.defaults.timeline.variant.
effect?EffectPropEffect or effects applied to each entry's content column (the card in the carded look) (e.g. "lift", ["tilt", "glow"]). If omitted, UIProvider appearance.defaults.timeline.effect. See BuiltinEffect.
size?Size"md"Size: marker, text and spacing.
groupBy?TimelineGroupBy<T>Groups entries and puts a heading at the start of each group (e.g. "Today", "Yesterday", "October 2026"). See TimelineGroupBy. Entries are assumed sorted; consecutive entries with the same key form a group. Applies only to vertical timelines.
groupLabel?(key: string, date: Date | undefined) => ReactNodeCustomizes the group heading. key is the group key ("2026-10-31", "2026-10", "2026" or what the groupBy function returned), date is the date of the first entry in the group.
stickyGroups?booleanfalseThe group heading stays stuck at the top while scrolling.
collapsibleGroups?boolean | readonly string[]Groups toggle when their heading is clicked; the heading shows the entry count. If true, all start open; if an array is given, only groups with these keys start open.
sort?"asc" | "desc"Sorts entries by date: "asc" oldest to newest, "desc" newest to oldest.
timeFormat?TimelineTimeFormat | ((date: Date) => ReactNode)Time (`14:30`) in day groups, day and time in month groups, date and time without grouping.Format of the time: Intl options ({ dateStyle: "medium" }), "relative" ("3 hours ago") or a function producing content from the date.
locale?stringLocale for dates and relative time. Defaults to the UIProvider's locale in a client tree, "tr-TR" on the server.
timeZone?stringTime zone (e.g. "Europe/Istanbul"). If omitted, the time zone of the rendering environment. For timelines rendered on the server and re-rendered on the client (inside a client component), pass it so both sides produce the same text.
now?TimelineDateThe moment "Today", "Yesterday" and relative time ("3 hours ago") are computed from. If omitted, the render time.
collapsible?booleanfalseWhether entries with content (content) toggle when their title is clicked. The entry's collapsible takes precedence. The browser's find in page (Ctrl+F) finds and opens collapsed content too.
maxVisible?numberHow many entries are visible first in a vertical timeline? The rest are hidden behind a "Show N more entries" button. Needs no JavaScript.
loading?boolean | number3 placeholders (`true`)Loading view: faded placeholders instead of content. If a number is given, that many placeholders are drawn. If items isn't empty, the placeholders are appended at the end (while the next page loads in infinite scrolling).
empty?ReactNodeContent shown when there are no entries. Defaults to the UIProvider text ("Henüz kayıt yok" in Turkish).
responsive?booleantrueWhether a vertical timeline switches to a single column on small screens (below 640 px). The line moves to the start and the opposite content drops above the title.
oppositeWidth?string"6rem"Width of the opposite column (with align="start" or "end" and timePosition="opposite"). Any CSS length.
itemWidth?string8rem`, `10rem`, `12rem` by sizeMinimum width of an entry in a horizontal timeline. Entries fill the area; if they don't fit it scrolls sideways.
headingLevel?number3Level of group headings (<h1>–<h6>).
labels?Partial<TimelineLabels>Component texts. See TimelineLabels.
classNames?TimelineClassNamesClasses added to the inner parts.