Class: Tailwinds::Nav::Item::ButtonComponent

Inherits:
TailwindComponent show all
Defined in:
app/components/tailwinds/nav/item/button_component.rb

Overview

Render button styled with Tailwind using button_to methods

Instance Method Summary collapse

Methods included from Tramway::Helpers::ComponentHelper

#component

Constructor Details

#initialize(**options) ⇒ ButtonComponent

Returns a new instance of ButtonComponent.



11
12
13
14
15
16
# File 'app/components/tailwinds/nav/item/button_component.rb', line 11

def initialize(**options)
  @href = options[:href]
  @method = options[:method]
  @style = 'text-white hover:bg-gray-300 hover:text-gray-800 px-4 py-2 rounded whitespace-nowrap'
  @options = options.except(:href, :method)
end