Skip to content

Use Layout to build a main/sidebar layout.

Arguments

NameTypeDefaultDescription
responsiveBooleanfalseWhether to collapse layout to a single column at smaller widths.
sideSymbol:rightWhich side to display the sidebar on. One of :left and :right.
sidebar_colInteger3Sidebar column width.
system_argumentsHashN/ASystem arguments

Slots

Main

The main content

NameTypeDefaultDescription
system_argumentsHashN/ASystem arguments

The sidebar content

NameTypeDefaultDescription
system_argumentsHashN/ASystem arguments

Examples

Default

Main
Sidebar
<%= render(Primer::LayoutComponent.new) do |component| %>
<% component.sidebar { "Sidebar" } %>
<% component.main { "Main" } %>
<% end %>
Sidebar
Main
<%= render(Primer::LayoutComponent.new(side: :left)) do |component| %>
<% component.sidebar { "Sidebar" } %>
<% component.main { "Main" } %>
<% end %>