class Primer::Alpha::ButtonMarketing

Use ‘ButtonMarketing` for actions (e.g. in forms). Use links for destinations, or moving from one page to another.

def call

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

def initialize(

Parameters:
  • system_arguments (Hash) -- <%= link_to_system_arguments_docs %>
  • disabled (Boolean) -- Whether or not the button is disabled. If true, this option forces `tag:` to `:button`.
  • type (Symbol) -- <%= one_of(Primer::Alpha::ButtonMarketing::TYPE_OPTIONS) %>
  • tag (Symbol) -- <%= one_of(Primer::Alpha::ButtonMarketing::TAG_OPTIONS) %>
  • variant (Symbol) -- <%= one_of(Primer::Alpha::ButtonMarketing::VARIANT_OPTIONS) %>
  • scheme (Symbol) -- <%= one_of(Primer::Alpha::ButtonMarketing::SCHEME_OPTIONS) %>
def initialize(
  scheme: DEFAULT_SCHEME,
  variant: DEFAULT_VARIANT,
  tag: DEFAULT_TAG,
  type: DEFAULT_TYPE,
  disabled: false,
  **system_arguments
)
  @system_arguments = system_arguments
  @system_arguments[:block] = false
  @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
  @system_arguments[:type] = fetch_or_fallback(TYPE_OPTIONS, type, DEFAULT_TYPE)
  @system_arguments[:classes] = class_names(
    "btn-mktg",
    SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_OPTIONS, scheme, DEFAULT_SCHEME)],
    VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_OPTIONS, variant, DEFAULT_VARIANT)],
    system_arguments[:classes]
  )
  @system_arguments[:disabled] = disabled
end