Class: Tailwinds::NavbarComponent

Inherits:
TailwindComponent show all
Includes:
BackgroundHelper
Defined in:
app/components/tailwinds/navbar_component.rb

Overview

Navbar class main class

Constant Summary

Constants included from BackgroundHelper

BackgroundHelper::CSS_COLORS, BackgroundHelper::DEFAULT_BACKGROUND_COLOR, BackgroundHelper::DEFAULT_BACKGROUND_INTENSITY, BackgroundHelper::MAX_INTENSITY, BackgroundHelper::MIN_INTENSITY

Instance Method Summary collapse

Methods included from BackgroundHelper

background

Methods included from Tramway::Helpers::ComponentHelper

#component

Constructor Details

#initialize(**options) ⇒ NavbarComponent

Returns a new instance of NavbarComponent.



35
36
37
38
39
40
# File 'app/components/tailwinds/navbar_component.rb', line 35

def initialize(**options)
  @title = { text: options[:title], link: options[:title_link] || '/' }
  @left_items = options[:left_items]
  @right_items = options[:right_items]
  @color = BackgroundHelper.background(options)
end