class Primer::Beta::State

Use ‘State` for rendering the status of an item.

def call

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

def initialize(

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
  • size (Symbol) -- <%= one_of(Primer::Beta::State::SIZE_OPTIONS) %>
  • tag (Symbol) -- HTML tag for element. <%= one_of(Primer::Beta::State::TAG_OPTIONS) %>
  • scheme (Symbol) -- Background color. <%= one_of(Primer::Beta::State::SCHEME_OPTIONS) %>
  • title (String) -- `title` HTML attribute.
def initialize(
  title:,
  scheme: SCHEME_DEFAULT,
  tag: TAG_DEFAULT,
  size: SIZE_DEFAULT,
  **system_arguments
)
  @system_arguments = system_arguments
  @system_arguments[:title] = title
  @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, TAG_DEFAULT)
  @system_arguments[:classes] = class_names(
    @system_arguments[:classes],
    "State",
    SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_OPTIONS, scheme, SCHEME_DEFAULT)],
    SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, SIZE_DEFAULT)]
  )
end