Skip to content

Label

Use labels to add contextual metadata to a design.

Examples

Schemes

<%= render(Primer::LabelComponent.new(title: "Label: Label")) { "default" } %>
<%= render(Primer::LabelComponent.new(title: "Label: Label", scheme: :gray)) { "gray" } %>
<%= render(Primer::LabelComponent.new(title: "Label: Label", scheme: :dark_gray)) { "dark_gray" } %>
<%= render(Primer::LabelComponent.new(title: "Label: Label", scheme: :yellow)) { "yellow" } %>
<%= render(Primer::LabelComponent.new(title: "Label: Label", scheme: :green)) { "green" } %>
<%= render(Primer::LabelComponent.new(title: "Label: Label", scheme: :purple)) { "purple" } %>

Variants

<%= render(Primer::LabelComponent.new(title: "Label: Label")) { "Default" } %>
<%= render(Primer::LabelComponent.new(title: "Label: Label", variant: :large)) { "Large" } %>

Arguments

NameTypeDefaultDescription
titleStringN/Atitle attribute for the component element.
schemeSymbolnilOne of :gray, :dark_gray, :yellow, :orange, :red, :green, :blue, :purple, :pink, :outline, or :green_outline.
variantSymbolnilOne of :large, :inline, or nil.
system_argumentsHashN/ASystem arguments