Skip to content

Breadcrumb

Use breadcrumbs to display page hierarchy within a section of the site. All of the items in the breadcrumb "trail" are links except for the final item, which is a plain string indicating the current page.

Examples

Basic

<%= render(Primer::BreadcrumbComponent.new) do |component| %>
<% component.slot(:item, href: "/") do %>Home<% end %>
<% component.slot(:item, href: "/about") do %>About<% end %>
<% component.slot(:item, selected: true) do %>Team<% end %>
<% end %>

Arguments

NameTypeDefaultDescription
system_argumentsHashN/ASystem arguments

item slot

NameTypeDefaultDescription
hrefStringnilThe URL to link to.
selectedBooleanfalseWhether or not the item is selected and not rendered as a link.
system_argumentsHashN/ASystem arguments

Note: if both href and selected: true are passed in, href will be ignored and the item will not be rendered as a link.