Sha256: fdb035d4bdb73191bc6bc881aea91d15d8fcf30232dec05054f0f2f525065415

Contents?: true

Size: 1.67 KB

Versions: 140

Compression:

Stored size: 1.67 KB

Contents

# frozen_string_literal: true

module Primer
  module Alpha
    FormButton = Primer::FormComponents.from_input(Primer::Forms::Dsl::ButtonInput)

    # A button input rendered using the HTML `<button type="button">` tag.
    #
    # This component wraps the Primer button component and supports the same slots and arguments.
    #
    # @form_usage
    #   class ExampleForm < ApplicationForm
    #     form do |example_form|
    #       example_form.button(attributes)
    #     end
    #   end
    class FormButton < Primer::Component
      status :alpha

      # @!method initialize
      #
      # @param name [String] Value for the HTML name attribute.
      # @param id [String] Value for the HTML id attribute.
      # @param class [String] CSS classes to include in the input's HTML `class` attribute. Exists for compatibility with Rails form builders.
      # @param classes [Array] CSS classes to include in the input's HTML `class` attribute. Combined with the `:class` argument. The list may contain strings, hashes, or `nil` values, and is automatically cleaned up by Primer's [`class_name` helper](https://github.com/primer/view_components/blob/c9cb95c98fee3e2e27f4a10683f555e22285e7f1/app/lib/primer/class_name_helper.rb) (`nils`, falsy entries, and blank strings are ignored).
      # @param label [String] Label text displayed above the input.
      # @param aria [Hash] Key/value pairs that represent Aria attributes and their values. Eg. `aria: { current: true }` becomes `aria-current="true"`.
      # @param data [Hash] Key/value pairs that represent data attributes and their values. Eg. `data: { foo: "bar" }` becomes `data-foo="bar"`.
      # @macro form_system_arguments
    end
  end
end

Version data entries

140 entries across 140 versions & 2 rubygems

Version Path
primer_view_components-0.36.5 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.52.2 app/components/primer/alpha/form_button.rb
primer_view_components-0.36.4 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.52.1 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.52.0 app/components/primer/alpha/form_button.rb
primer_view_components-0.36.3 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.51.0 app/components/primer/alpha/form_button.rb
primer_view_components-0.36.2 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.50.1 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.50.0 app/components/primer/alpha/form_button.rb
primer_view_components-0.36.1 app/components/primer/alpha/form_button.rb
primer_view_components-0.36.0 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.49.2 app/components/primer/alpha/form_button.rb
primer_view_components-0.35.2 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.49.1 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.49.0 app/components/primer/alpha/form_button.rb
primer_view_components-0.35.1 app/components/primer/alpha/form_button.rb
primer_view_components-0.35.0 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.48.2 app/components/primer/alpha/form_button.rb
openproject-primer_view_components-0.48.1 app/components/primer/alpha/form_button.rb