Class: Primer::Beta::ButtonGroup
- Defined in:
- app/components/primer/beta/button_group.rb
Overview
Use ‘ButtonGroup` to render a series of buttons.
Defined Under Namespace
Classes: MenuButton
Constant Summary
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Constants included from AttributesHelper
AttributesHelper::PLURAL_ARIA_ATTRIBUTES, AttributesHelper::PLURAL_DATA_ATTRIBUTES
Instance Method Summary collapse
-
#initialize(scheme: Primer::Beta::Button::DEFAULT_SCHEME, size: Primer::Beta::Button::DEFAULT_SIZE, **system_arguments) ⇒ ButtonGroup
constructor
A new instance of ButtonGroup.
- #render? ⇒ Boolean
-
#with_button(icon: nil, **system_arguments) ⇒ Object
Adds a button.
-
#with_clipboard_copy_button(**system_arguments) ⇒ Object
Adds a <%= link_to_component(Primer::Beta::ClipboardCopyButton) %>.
-
#with_menu_button(**system_arguments) ⇒ Object
Adds a button that activates a menu when clicked.
Methods inherited from Component
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Methods included from AttributesHelper
#aria, #data, #extract_data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes
Methods included from ExperimentalSlotHelpers
Methods included from ExperimentalRenderHelpers
Constructor Details
#initialize(scheme: Primer::Beta::Button::DEFAULT_SCHEME, size: Primer::Beta::Button::DEFAULT_SIZE, **system_arguments) ⇒ ButtonGroup
Returns a new instance of ButtonGroup.
72 73 74 75 76 77 78 79 80 81 82 |
# File 'app/components/primer/beta/button_group.rb', line 72 def initialize(scheme: Primer::Beta::Button::DEFAULT_SCHEME, size: Primer::Beta::Button::DEFAULT_SIZE, **system_arguments) @size = size @scheme = scheme @system_arguments = deny_tag_argument(**system_arguments) @system_arguments[:tag] = :div @system_arguments[:classes] = class_names( "ButtonGroup", system_arguments[:classes] ) end |
Instance Method Details
#render? ⇒ Boolean
84 85 86 |
# File 'app/components/primer/beta/button_group.rb', line 84 def render? .any? end |
#with_button(icon: nil, **system_arguments) ⇒ Object
Adds a button.
5 6 |
# File 'app/components/primer/beta/button_group.rb', line 5 def (icon: nil, **system_arguments) end |
#with_clipboard_copy_button(**system_arguments) ⇒ Object
Adds a <%= link_to_component(Primer::Beta::ClipboardCopyButton) %>.
4 5 |
# File 'app/components/primer/beta/button_group.rb', line 4 def (**system_arguments) end |
#with_menu_button(**system_arguments) ⇒ Object
Adds a button that activates a menu when clicked.
4 5 |
# File 'app/components/primer/beta/button_group.rb', line 4 def (**system_arguments) end |