Rost

← All components

component

Timeline

What happened to something, in order: a column of TimelineItems, each a dot on a line with what happened and when.

In code Contract: review Guidance: proposed Contract on GitHub Figma 746:64 As markdown
  1. Paid

    Client 1 paid by bank transfer.

  2. Opened

  3. Sent to Client 1

Default

Install

npx github:Runceanu/rost add timeline

It lands in src/rost/timeline/, with what it needs and its contract. Install has the rest.

When to use

  • The history of one thing

    An invoice that was drafted, sent, opened and paid. A vault that was set up and then shared.

When not to use

  • Steps still to do

    A Timeline is what already happened. Steps someone has to go through are a Stepper.

    Use Stepper

  • A feed

    Many unrelated things from many places. That's a list of ListItems.

Behaviour

It lays the items in a column and tells the last one it's last, so its line stops at its dot.

Accessibility

  • Element

    <ol>, so a screen reader says how many events there are.

  • Name

    Give it an aria-label when the heading above it doesn't say what it's the history of.

Content

Each item says what happened in a few words, past tense: Sent to Client 1, Paid.

Props

PropTypeValuesDefault
children slot

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • margin 0px spacing/gap/none
  • padding 0px spacing/gap/none

displayflex · flex-directioncolumn · list-stylenone

Part of Timeline

TimelineItem

One event in a Timeline: a 12px dot, a line down to the next event, what happened, when, and a sentence if it needs one.

In code Contract: review Guidance: proposed Contract on GitHub Figma 746:62 As markdown
  1. Sent to Client 1

Not current · Not last
  1. Sent to Client 1

Current · Not last
  1. Sent to Client 1

Not current · Last
  1. Sent to Client 1

Current · Last

Install

npx github:Runceanu/rost add timeline-item

It lands in src/rost/timeline-item/, with what it needs and its contract. Install has the rest.

When to use

  • Now in green

    Mark the event that says where things stand now as current. Only one, and usually the newest.

When not to use

  • Colour as the only signal

    The green dot means now, but the title has to say what happened. Nobody should need the colour to read it.

Behaviour

The dot and line are drawing. The title, the time and the sentence are the content.

Accessibility

  • Element

    <li>, with the time in a <time> element. The current one has aria-current="step". The dot and line are hidden from screen readers.

  • Colour

    The past dot is 4.3:1 on the dark page, the current one 10:1. The title is 17:1, the time 7:1.

Props

PropTypeValuesDefault
current boolean false
last boolean false
title slot
time slot
children slot

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • gap 12px spacing/gap/small-medium

displayflex

rail

  • width 12px spacing/size/3xsmall
  • padding-top 4px spacing/gap/2xsmall

displayflex · flex-directioncolumn · align-itemscenter · flex-shrink0

dot

  • width 12px spacing/size/3xsmall
  • height 12px spacing/size/3xsmall
  • border-radius 10000px spacing/radius/full

displayblock · flex-shrink0

line

  • width 1px spacing/outline/small
  • margin-top 4px spacing/gap/2xsmall
  • background #3a3a3a timeline-item/line

displayblock · flex-grow1

content

  • gap 2px spacing/gap/3xsmall
  • padding-bottom 24px spacing/gap/large

displayflex · flex-directioncolumn · min-width0

title

  • margin 0px spacing/gap/none
  • font-family 'General Sans Variable' font-family/base
  • font-weight 500 typography/paragraph/font-weight/medium
  • font-size 14px typography/paragraph/font-size
  • line-height 20px typography/paragraph/line-height
  • letter-spacing 0px typography/paragraph/letter-spacing
  • color #ededed timeline-item/title

time

  • font-family 'General Sans Variable' font-family/base
  • font-weight 400 typography/label/font-weight/regular
  • font-size 12px typography/label/font-size
  • line-height 14px typography/label/line-height
  • letter-spacing 0px typography/label/letter-spacing
  • color #999999 timeline-item/time

body

  • margin 0px spacing/gap/none
  • font-family 'General Sans Variable' font-family/base
  • font-weight 400 typography/paragraph/font-weight/regular
  • font-size 14px typography/paragraph/font-size
  • line-height 20px typography/paragraph/line-height
  • letter-spacing 0px typography/paragraph/letter-spacing
  • color #d3d9d5 timeline-item/body

Changes by variant

4 variants. Each table is what one thing changes with: a column per current, a row per property. Where every row starts with the same token path, it's written once, under the property.

Follows current

PropertyNot currentCurrent
dot.backgroundtimeline-item/… past/dot #747573 current/dot #00d669

Only in some variants

These don't change: they're just set in some variants and not others.

Last

  • content.padding-bottom 0px spacing/gap/none
  • line.display none layout