Class: Primer::Alpha::CheckBoxGroup

Inherits:
Component
  • Object
show all
Defined in:
app/components/primer/alpha/check_box_group.rb

Overview

Check box groups consist of one or more related check boxes.

Constant Summary

Constants inherited from Component

Component::INVALID_ARIA_LABEL_TAGS

Constants included from Status::Dsl

Status::Dsl::STATUSES

Constants included from ViewHelper

ViewHelper::HELPERS

Constants included from TestSelectorHelper

TestSelectorHelper::TEST_SELECTOR_TAG

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Constants included from Primer::AttributesHelper

Primer::AttributesHelper::PLURAL_ARIA_ATTRIBUTES, Primer::AttributesHelper::PLURAL_DATA_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from Component

deprecated?, generate_id

Methods included from JoinStyleArgumentsHelper

#join_style_arguments

Methods included from TestSelectorHelper

#add_test_selector

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?

Methods included from ClassNameHelper

#class_names

Methods included from Primer::AttributesHelper

#aria, #data, #merge_aria, #merge_data, #merge_prefixed_attribute_hashes

Constructor Details

#initializeObject

Parameters:

  • name (String)

    Value for the HTML name attribute. When provided, the check box values will be submitted in to the server in :array mode. See the <%= link_to_component(Primer::Alpha::CheckBox) %> for more information.

  • label (String)

    Label text displayed above the input.

  • hidden (Boolean)

    When set to true, visually hides the group.

  • caption (String)

    A string describing the field and what sorts of input it expects. Displayed below the group.

  • label_arguments (Hash)

    Attributes that will be passed to Rails’ builder.label method. These can be HTML attributes or any of the other label options Rails supports. They will appear as HTML attributes on the ‘<label>` tag.



# File 'app/components/primer/alpha/check_box_group.rb', line 20

Instance Method Details

#check_boxObject

Adds a check box to the group.

Parameters:

  • system_arguments (Hash)

    The arguments accepted by <%= link_to_component(Primer::Alpha::CheckBox) %>.

  • block (Proc)

    The block accepted by <%= link_to_component(Primer::Alpha::CheckBox) %>.



# File 'app/components/primer/alpha/check_box_group.rb', line 28