Skip to content

State

Table of contents
Table of contents

Use State for rendering the status of an item.

Examples

Default

State
<%= render(Primer::StateComponent.new(title: "title")) { "State" } %>

Schemes

DefaultOpenClosedMerged
<%= render(Primer::StateComponent.new(title: "title")) { "Default" } %>
<%= render(Primer::StateComponent.new(title: "title", scheme: :open)) { "Open" } %>
<%= render(Primer::StateComponent.new(title: "title", scheme: :closed)) { "Closed" } %>
<%= render(Primer::StateComponent.new(title: "title", scheme: :merged)) { "Merged" } %>

Sizes

DefaultSmall
<%= render(Primer::StateComponent.new(title: "title")) { "Default" } %>
<%= render(Primer::StateComponent.new(title: "title", size: :small)) { "Small" } %>

Arguments

NameTypeDefaultDescription
titleStringN/Atitle HTML attribute.
schemeSymbol:defaultBackground color. One of :open, :closed, :merged, :default, :green, :red, or :purple.
tagSymbol:spanHTML tag for element. One of :span and :div.
sizeSymbol:defaultOne of :default and :small.
system_argumentsHashN/ASystem arguments