Skip to content

Use Menu to create vertical lists of navigational links.

Arguments

NameTypeDefaultDescription
system_argumentsHashN/ASystem arguments

Slots

Heading

Optional menu heading

NameTypeDefaultDescription
tagSymbolN/AOne of :h1, :h2, :h3, :h4, :h5, or :h6.
system_argumentsHashN/ASystem arguments

Items

Required list of navigational links

NameTypeDefaultDescription
hrefStringN/AURL to be used for the Link
selectedBooleanN/AWhether the item is the current selection
system_argumentsHashN/ASystem arguments

Examples

Default

<%= render(Primer::MenuComponent.new) do |c| %>
<% c.heading(tag: :h2) do %>
Heading
<% end %>
<% c.item(selected: true, href: "#url") do %>
Item 1
<% end %>
<% c.item(href: "#url") do %>
<%= render(Primer::OcticonComponent.new("check")) %>
With Icon
<% end %>
<% c.item(href: "#url") do %>
<%= render(Primer::OcticonComponent.new("check")) %>
With Icon and Counter
<%= render(Primer::CounterComponent.new(count: 25)) %>
<% end %>
<% end %>