The timeline kit can use two different line styles in the same timeline - solid and dotted line styles.
To view different colors of icon circle, visit Icon Circle Kit.
<%= pb_rails("timeline") do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> <%= pb_rails("body", props: { text: "Conversation started", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal"}) do %> <%= pb_rails("body", props: { text: "Trip #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> <%= pb_rails("body", props: { text: "Refund issue #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "smile", icon_color: "green"}) do %> <%= pb_rails("body", props: { text: "Conversation resolved", color: "light" }) %> <% end %> <% end %> <br /><br /> <%= pb_rails("timeline") do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "dotted" }) do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal" }) do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <% end %>
<%= pb_rails("timeline", props: {orientation: "vertical"}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> <%= pb_rails("body", props: { text: "Conversation started", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal"}) do %> <%= pb_rails("body", props: { text: "Trip #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> <%= pb_rails("body", props: { text: "Refund issue #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "smile", icon_color: "green"}) do %> <%= pb_rails("body", props: { text: "Conversation resolved", color: "light" }) %> <% end %> <% end %> <br /><br /> <%= pb_rails("timeline", props: {orientation: "vertical"}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "dotted"}) do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal" }) do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <% end %>
Use the optional showDate prop to render the timeline kit with a visible date. By default, if the date is from the current year, the year will not be displayed; however, if the date is NOT from the current year, the kit will display the year as well.
<%= pb_rails("timeline", props: {orientation: "horizontal", show_date: true}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "solid", date: Date.today }) do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted" }) do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.today+1 }) do %> <%= pb_rails("title_detail", props: { title: "Society Hill", detail: "72 E St Astoria" }) %> <% end %> <% end %> <br /><br /><br /> <%= pb_rails("timeline", props: {orientation: "vertical", show_date: true}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "solid", date: Date.today }) do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted" }) do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.today+1 }) do %> <%= pb_rails("title_detail", props: { title: "Society Hill", detail: "72 E St Astoria" }) %> <% end %> <% end %> <br /><br /><br /> <%= pb_rails("timeline", props: {orientation: "vertical", show_date: true}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "solid", date: Date.new(2018, 03, 20) }) do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted" }) do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.new(2018, 05, 20) }) do %> <%= pb_rails("title_detail", props: { title: "Society Hill", detail: "72 E St Astoria" }) %> <% end %> <% end %>
Any kit can be used inside of our compound components of label, step, or detail. Expand the code snippet below to see how to use these children elements.
<%= pb_rails("timeline", props: {orientation: "horizontal", show_date: true}) do %> <%= pb_rails("timeline/item", props: { line_style: "solid"}) do |item| %> <% item.label do %> <%= pb_rails("timeline/label") do %> <%= pb_rails("title", props: { text: "Any Kit Here", size: 2 }) %> <% end %> <% end %> <% item.step do %> <%= pb_rails("timeline/step", props: { icon: 'check', icon_color: 'teal' }) %> <% end %> <% item.detail do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <% end %> <%= pb_rails("timeline/item", props: { line_style: "dotted"}) do |item| %> <% item.step do %> <%= pb_rails("timeline/step") do %> <%= pb_rails("pill", props: { text: "Any Kit" , variant: "success" }) %> <% end %> <% end %> <% item.detail do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <% end %> <%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.today+1 }) do |item| %> <%= pb_rails("title_detail", props: { title: "Society Hill", detail: "72 E St Astoria" }) %> <% end %> <% end %> <br /><br /><br /> <%= pb_rails("timeline", props: {orientation: "vertical", show_date: true}) do %> <%= pb_rails("timeline/item") do |item| %> <% item.label do %> <%= pb_rails("timeline/label") do %> <%= pb_rails("title", props: { text: "Any Kit", size: 4 }) %> <% end %> <% end %> <% item.step do %> <%= pb_rails("timeline/step", props: { icon: 'user', icon_color: 'royal' }) %> <% end %> <% item.detail do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <% end %> <%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.today+1, line_style: "dotted" }) do |item| %> <%= pb_rails("title_detail", props: { title: "Society Hill", detail: "72 E St Astoria" }) %> <% end %> <%= pb_rails("timeline/item") do |item| %> <% item.step do %> <%= pb_rails("timeline/step") do %> <%= pb_rails("pill", props: { text: "3" , variant: "success" }) %> <% end %> <% end %> <% item.detail do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <% end %> <% end %>
By default, the Timeline kit does NOT display the year if it is the current year. If you want to display the current year you can do so by setting showCurrentYear/show_current_year to true. Pass it to Timeline.Item/timeline/item when using its date prop, or to Timeline.Label/timeline/label if following the "With Children" pattern.
<%= pb_rails("timeline", props: {orientation: "horizontal", show_date: true}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "solid", date: Date.today, show_current_year: true }) do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted" }) do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <%= pb_rails("timeline/item", props: { line_style: "solid"}) do |item| %> <% item.label do %> <%= pb_rails("timeline/label", props: { date: Date.today, show_current_year: true }) %> <% end %> <% item.step do %> <%= pb_rails("timeline/step", props: { icon: 'map-marker-alt', icon_color: 'purple' }) %> <% end %> <% item.detail do %> <%= pb_rails("title_detail", props: { title: "Society Hill", detail: "72 E St Astoria" }) %> <% end %> <% end %> <% end %> <br /><br /><br /> <%= pb_rails("timeline", props: {orientation: "vertical", show_date: true}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal", line_style: "solid", date: Date.today, show_current_year: true }) do %> <%= pb_rails("title_detail", props: { title: "Jackson Heights", detail: "37-27 74th Street" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted" }) do %> <%= pb_rails("title_detail", props: { title: "Greenpoint", detail: "81 Gate St Brooklyn" }) %> <% end %> <%= pb_rails("timeline/item", props: { line_style: "solid"}) do |item| %> <% item.label do %> <%= pb_rails("timeline/label", props: { date: Date.today, show_current_year: true }) %> <% end %> <% item.step do %> <%= pb_rails("timeline/step", props: { icon: 'map-marker-alt', icon_color: 'purple' }) %> <% end %> <% item.detail do %> <%= pb_rails("title_detail", props: { title: "Society Hill", detail: "72 E St Astoria" }) %> <% end %> <% end %> <% end %>
Use the optional itemGap prop to render the timeline kit with adjusted spacing between nodes. The itemGap prop will only work when utilized with a vertical timeline. Horizontal timelines will show no difference in spacing.
<%= pb_rails("flex", props: { justify: "evenly" }) do %> <%= pb_rails("flex/flex_item") do %> <%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "xs"}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> <%= pb_rails("body", props: { text: "Conversation started", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> <%= pb_rails("body", props: { text: "Trip #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> <%= pb_rails("body", props: { text: "Refund issue #12422", color: "light" }) %> <% end %> <% end %> <% end %> <%= pb_rails("flex/flex_item") do %> <%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "sm"}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> <%= pb_rails("body", props: { text: "Conversation started", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> <%= pb_rails("body", props: { text: "Trip #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> <%= pb_rails("body", props: { text: "Refund issue #12422", color: "light" }) %> <% end %> <% end %> <% end %> <%= pb_rails("flex/flex_item") do %> <%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "md"}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> <%= pb_rails("body", props: { text: "Conversation started", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> <%= pb_rails("body", props: { text: "Trip #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> <%= pb_rails("body", props: { text: "Refund issue #12422", color: "light" }) %> <% end %> <% end %> <% end %> <%= pb_rails("flex/flex_item") do %> <%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "lg"}) do %> <%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> <%= pb_rails("body", props: { text: "Conversation started", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> <%= pb_rails("body", props: { text: "Trip #12422", color: "light" }) %> <% end %> <%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> <%= pb_rails("body", props: { text: "Refund issue #12422", color: "light" }) %> <% end %> <% end %> <% end %> <% end %>
| Props | Type | Values |
|---|---|---|
align_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
align_items |
enum | responsive
|
start
end
center
|
border_radius |
enum
|
none
xs
sm
md
lg
xl
rounded
|
cursor |
enum
|
auto
default
none
contextMenu
help
pointer
progress
wait
cell
|
dark |
boolean
|
true
false
|
flex |
enum | responsive
|
auto
initial
0
1
2
3
4
5
6
7
8
9
10
11
12
none
|
flex_direction |
enum | responsive
|
row
column
rowReverse
columnReverse
|
flex_wrap |
enum | responsive
|
wrap
nowrap
wrapReverse
|
justify_content |
enum | responsive
|
start
end
center
spaceBetween
spaceAround
spaceEvenly
|
line_height |
enum
|
loosest
looser
loose
normal
tight
tighter
tightest
|
margin_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
margin |
array
|
none
xxs
xs
sm
md
lg
xl
|
width |
string
|
|
min_width |
string
|
|
max_width |
string
|
|
gap |
string | responsive
|
|
column_gap |
string | responsive
|
|
row_gap |
string | responsive
|
|
number_spacing |
enum
|
tabular
|
order |
enum | responsive
|
none
first
1
2
3
4
5
6
7
8
9
10
11
12
|
overflow_x |
enum
|
scroll
visible
hidden
auto
|
overflow_y |
enum
|
scroll
visible
hidden
auto
|
overflow |
enum
|
scroll
visible
hidden
auto
|
padding_right |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_left |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_top |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_bottom |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_x |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding_y |
array
|
none
xxs
xs
sm
md
lg
xl
|
padding |
array
|
none
xxs
xs
sm
md
lg
xl
|
position |
enum
|
relative
absolute
fixed
sticky
static
|
shadow |
enum
|
none
deep
deeper
deepest
|
text_align |
enum | responsive
|
start
end
left
right
center
justify
justifyAll
matchParent
|
truncate |
enum
|
none
1
2
3
4
5
|
vertical_align |
enum | responsive
|
baseline
super
top
middle
bottom
sub
text-top
text-bottom
|
z_index |
enum | responsive
|
1
2
3
4
5
6
7
8
9
10
max
|
top |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
inset |
boolean
|
true
false
|
right |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
bottom |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
left |
enum | object
|
xxs
xs
sm
md
lg
xl
xxl
|
height |
string
|
|
max_height |
string
|
|
min_height |
string
|
|
hover |
object
|
|
group_hover |
boolean
|
true
false
|
| Props | Type | Values | Default |
|---|---|---|---|
orientation |
string
|
vertical
horizontal
|
horizontal
|
show_date |
boolean
|
true
false
|
false
|
item_gap |
enum
|
xs
sm
md
lg
none
|
none
|