Class: Tailwinds::Form::SubmitButtonComponent

Inherits:
TailwindComponent show all
Defined in:
app/components/tailwinds/form/submit_button_component.rb

Overview

Tailwind-styled submit button

Constant Summary

Constants inherited from TailwindComponent

TailwindComponent::SIZE_CLASSES

Instance Method Summary collapse

Methods included from Tramway::Helpers::ViewsHelper

#tramway_back_button, #tramway_badge, #tramway_button, #tramway_cell, #tramway_container, #tramway_flash, #tramway_form_for, #tramway_header, #tramway_row, #tramway_table, #tramway_title

Methods included from Tramway::Helpers::ComponentHelper

#component

Methods included from Tramway::Helpers::DecorateHelper

#tramway_decorate

Constructor Details

#initialize(action, size: :middle, **options) ⇒ SubmitButtonComponent

Returns a new instance of SubmitButtonComponent.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/components/tailwinds/form/submit_button_component.rb', line 7

def initialize(action, size: :middle, **options)
  @text = action.is_a?(String) ? action : action.to_s.capitalize

  super(
    input: nil,
    attribute: nil,
    value: nil,
    options: options.except(:type),
    label: nil,
    for: nil,
    size:
  )
end