Class: Tailwinds::NavbarComponent
- Inherits:
-
TailwindComponent
- Object
- ViewComponent::Base
- Tramway::BaseComponent
- TailwindComponent
- Tailwinds::NavbarComponent
- Defined in:
- app/components/tailwinds/navbar_component.rb
Overview
Navbar component
Constant Summary
Constants inherited from TailwindComponent
TailwindComponent::SIZE_CLASSES
Constants included from Tramway::Helpers::ViewsHelper
Tramway::Helpers::ViewsHelper::FORM_SIZES
Instance Method Summary collapse
-
#initialize(**options) ⇒ NavbarComponent
constructor
A new instance of NavbarComponent.
- #mobile_button_classes ⇒ Object
- #mobile_menu_classes ⇒ Object
- #navbar_classes ⇒ Object
- #title_classes ⇒ Object
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_main_container, #tramway_row, #tramway_table, #tramway_title
Methods included from Tramway::Helpers::ComponentHelper
Methods included from Tramway::Helpers::DecorateHelper
Constructor Details
#initialize(**options) ⇒ NavbarComponent
Returns a new instance of NavbarComponent.
6 7 8 9 10 |
# File 'app/components/tailwinds/navbar_component.rb', line 6 def initialize(**) @title = { text: [:title], link: [:title_link] || '/' } @left_items = [:left_items] @right_items = [:right_items] end |
Instance Method Details
#mobile_button_classes ⇒ Object
24 25 26 27 28 |
# File 'app/components/tailwinds/navbar_component.rb', line 24 def theme_classes( classic: 'text-gray-200 focus:outline-none' ) end |
#mobile_menu_classes ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/components/tailwinds/navbar_component.rb', line 30 def theme_classes( classic: [ 'hidden', 'inset-0', 'flex-col', 'bg-gray-900', 'shadow-inner', 'h-screen', 'fixed', 'z-50', 'w-screen', 'transition-transform', 'transform', '-translate-x-full', 'duration-300', 'ease-in-out', 'pt-16' ].join(' ') ) end |
#navbar_classes ⇒ Object
12 13 14 15 16 |
# File 'app/components/tailwinds/navbar_component.rb', line 12 def theme_classes( classic: 'py-2 px-4 sm:px-8 flex justify-between items-center bg-gray-900 shadow-md' ) end |
#title_classes ⇒ Object
18 19 20 21 22 |
# File 'app/components/tailwinds/navbar_component.rb', line 18 def title_classes theme_classes( classic: 'text-xl font-semibold text-gray-100' ) end |