class Primer::Alpha::Layout::Main
The layout’s main content.
def call
def call render(Primer::BaseComponent.new(**@system_arguments)) do if @width == :full content else render(Primer::BaseComponent.new(tag: :div, classes: "Layout-main-centered-#{@width}")) do render(Primer::BaseComponent.new(tag: :div, container: @width)) do content end end end end end
def initialize(tag: TAG_DEFAULT, width: WIDTH_DEFAULT, **system_arguments)
-
system_arguments
(Hash
) -- <%= link_to_system_arguments_docs %> -
width
(Symbol
) -- <%= one_of(Primer::Alpha::Layout::Main::WIDTH_OPTIONS) %>
def initialize(tag: TAG_DEFAULT, width: WIDTH_DEFAULT, **system_arguments) @width = fetch_or_fallback(WIDTH_OPTIONS, width, WIDTH_DEFAULT) @system_arguments = system_arguments @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, TAG_DEFAULT) @system_arguments[:classes] = class_names( "Layout-main", system_arguments[:classes] ) end