Method: Primer::Alpha::SegmentedControl#initialize
- Defined in:
- app/components/primer/alpha/segmented_control.rb
permalink #initialize(hide_labels: HIDE_LABELS_DEFAULT, full_width: FULL_WIDTH_DEFAULT, size: Primer::Beta::Button::DEFAULT_SIZE, **system_arguments) ⇒ SegmentedControl
Returns a new instance of SegmentedControl.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'app/components/primer/alpha/segmented_control.rb', line 43 def initialize(hide_labels: HIDE_LABELS_DEFAULT, full_width: FULL_WIDTH_DEFAULT, size: Primer::Beta::Button::DEFAULT_SIZE, **system_arguments) @full_width = full_width @size = size @hide_labels = hide_labels @system_arguments = system_arguments @system_arguments[:tag] = :ul @system_arguments[:role] = "list" @system_arguments[:classes] = class_names( system_arguments[:classes], SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)], "SegmentedControl", "SegmentedControl--iconOnly": hide_labels, "SegmentedControl--fullWidth": full_width ) validate_aria_label end |