Class: Flowbite::Sidebar::Navigation
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Flowbite::Sidebar::Navigation
- Defined in:
- app/components/flowbite/sidebar/navigation.rb
Overview
Renders the navigation list for a sidebar.
This component renders a <ul> with navigation items. It can be used inside a Flowbite::Sidebar for a fixed-position sidebar, or standalone in any layout that needs sidebar-style navigation.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(class: nil, **options) ⇒ Navigation
constructor
A new instance of Navigation.
Constructor Details
#initialize(class: nil, **options) ⇒ Navigation
Returns a new instance of Navigation.
37 38 39 40 41 |
# File 'app/components/flowbite/sidebar/navigation.rb', line 37 def initialize(class: nil, **) super() @class = Array.wrap(binding.local_variable_get(:class)) @options = end |
Class Method Details
.classes ⇒ Object
30 31 32 |
# File 'app/components/flowbite/sidebar/navigation.rb', line 30 def classes ["space-y-2", "font-medium"] end |
Instance Method Details
#call ⇒ Object
43 44 45 46 47 48 49 |
# File 'app/components/flowbite/sidebar/navigation.rb', line 43 def call content_tag(:ul, ) do items.each do |item| concat(item) end end end |