Skip to content

Menu

Table of contents
Table of contents

Use Menu to create vertical lists of navigational links.

Examples

Default

<%= render(Primer::MenuComponent.new) do |c| %>
<% c.heading 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 %>

Arguments

NameTypeDefaultDescription
system_argumentsHashN/ASystem arguments

Slots

Heading

Optional menu heading

NameTypeDefaultDescription
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