Sha256: 698c0f6a68caee93daf4bceeb7f2ecdfa40b31784351d1a28368305a0ef7f08f

Contents?: true

Size: 1.45 KB

Versions: 29

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    RadioButtonGroup = Primer::FormComponents.from_input(Primer::Forms::Dsl::RadioButtonGroupInput)

    # A group of mutually exclusive radio buttons.
    #
    # @form_usage
    #   class ExampleForm < ApplicationForm
    #     form do |example_form|
    #       example_form.radio_button_group(attributes) do |group|
    #         group.radio_button(radio_button_attributes)
    #       end
    #     end
    #   end
    class RadioButtonGroup < Primer::Component
      status :alpha

      # @!method initialize
      #
      # @param name [String] Value for the HTML name attribute.
      # @param label [String] Label text displayed above the input.
      # @param hidden [Boolean] When set to `true`, visually hides the group.
      # @param caption [String] A string describing the field and what sorts of input it expects. Displayed below the group.
      # @param 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.

      # @!method radio_button
      #
      # Adds a radio button to the group.
      #
      # @param system_arguments [Hash] The arguments accepted by <%= link_to_component(Primer::Alpha::RadioButton) %>.
      # @param block [Proc] The block accepted by <%= link_to_component(Primer::Alpha::RadioButton) %>.
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.11.0 app/components/primer/alpha/radio_button_group.rb
openproject-primer_view_components-0.10.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.9.0 app/components/primer/alpha/radio_button_group.rb
openproject-primer_view_components-0.9.1 app/components/primer/alpha/radio_button_group.rb
openproject-primer_view_components-0.9.0 app/components/primer/alpha/radio_button_group.rb
openproject-primer_view_components-0.8.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.8.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.7.0 app/components/primer/alpha/radio_button_group.rb
openproject-primer_view_components-0.7.0 app/components/primer/alpha/radio_button_group.rb
openproject-primer_view_components-0.6.3 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.6.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.5.1 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.5.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.4.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.3.1 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.3.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.2.0 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.1.9 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.1.8 app/components/primer/alpha/radio_button_group.rb
primer_view_components-0.1.7 app/components/primer/alpha/radio_button_group.rb