Skip to content

TimelineItem

Use timeline item to display items on a vertical timeline, connected by badge elements.
  • Beta
  • Not reviewed for accessibility

Use TimelineItem to display items on a vertical timeline, connected by badge elements.

Arguments

NameTypeDefaultDescription
condensedBooleanfalseReduce the vertical padding and remove the background from the badge item. Most commonly used in commits.
system_argumentsHashN/ASystem arguments

Slots

avatar

Avatar to be rendered to the left of the Badge.

NameTypeDefaultDescription
kwargsHashN/AThe same arguments as Avatar.

badge

Badge that will be connected to other TimelineItems.

NameTypeDefaultDescription
iconStringN/AName of Octicon to use.
system_argumentsHashN/ASystem arguments

body

Body to be rendered to the left of the Badge.

NameTypeDefaultDescription
system_argumentsHashN/ASystem arguments

Examples

Default

github
Success!
<div style="padding-left: 60px">
<%= render(Primer::Beta::TimelineItem.new) do |component| %>
<% component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "github") %>
<% component.with_badge(bg: :success_emphasis, color: :on_emphasis, icon: :check) %>
<% component.with_body { "Success!" } %>
<% end %>
</div>