class Primer::LabelComponent

Use ‘aria-label` if the `Label` or the context around it don’t explain the label.
@accessibility
Use ‘Label` to add contextual metadata to a design.

def call

def call
  render(Primer::BaseComponent.new(**@system_arguments)) { content }
end

def initialize(tag: DEFAULT_TAG, scheme: DEFAULT_SCHEME, variant: nil, **system_arguments)

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
  • variant (Symbol) -- <%= one_of(Primer::LabelComponent::VARIANT_OPTIONS) %>
  • scheme (Symbol) -- <%= one_of(Primer::LabelComponent::SCHEME_MAPPINGS.keys) %>
  • tag (Symbol) -- <%= one_of(Primer::LabelComponent::TAG_OPTIONS) %>

Other tags:
    Example: Variants -
    Example: Schemes -
def initialize(tag: DEFAULT_TAG, scheme: DEFAULT_SCHEME, variant: nil, **system_arguments)
  @system_arguments = system_arguments
  @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
  @system_arguments[:classes] = class_names(
    "Label",
    system_arguments[:classes],
    SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_OPTIONS, scheme, deprecated_values: DEPRECATED_SCHEME_OPTIONS)],
    VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_OPTIONS, variant)]
  )
end