class Primer::BaseButton
Use ‘BaseButton` to render an unstyled `<button>` tag that can be customized.
def call
def call render(Primer::BaseComponent.new(**@system_arguments)) { content } end
def initialize(
-
system_arguments(Hash) -- <%= link_to_system_arguments_docs %> -
block(Boolean) -- Whether button is full-width with `display: block`. -
type(Symbol) -- <%= one_of(Primer::BaseButton::TYPE_OPTIONS) %> -
tag(Symbol) -- <%= one_of(Primer::BaseButton::TAG_OPTIONS) %>
Other tags:
- Example: Block -
def initialize( tag: DEFAULT_TAG, type: DEFAULT_TYPE, block: false, **system_arguments ) @system_arguments = system_arguments @system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG) if @system_arguments[:tag] == :button @system_arguments[:type] = fetch_or_fallback(TYPE_OPTIONS, type, DEFAULT_TYPE) else @system_arguments[:role] = :button end @system_arguments[:classes] = class_names( system_arguments[:classes], "btn-block" => block ) end