Class: Flowbite::Sidebar
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Flowbite::Sidebar
- Defined in:
- app/components/flowbite/sidebar.rb,
app/components/flowbite/sidebar/item.rb,
app/components/flowbite/sidebar/navigation.rb
Overview
Renders a fixed-position sidebar container.
Use Sidebar as the outer shell and Navigation inside it to render the list of Items.
Defined Under Namespace
Classes: Item, Navigation
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(class: nil, **options) ⇒ Sidebar
constructor
A new instance of Sidebar.
Constructor Details
#initialize(class: nil, **options) ⇒ Sidebar
Returns a new instance of Sidebar.
34 35 36 37 38 |
# File 'app/components/flowbite/sidebar.rb', line 34 def initialize(class: nil, **) super() @class = Array.wrap(binding.local_variable_get(:class)) @options = end |
Class Method Details
.classes ⇒ Object
23 24 25 26 27 28 |
# File 'app/components/flowbite/sidebar.rb', line 23 def classes [ "fixed", "top-0", "left-0", "z-40", "w-64", "h-screen", "transition-transform", "-translate-x-full", "sm:translate-x-0" ] end |
Instance Method Details
#call ⇒ Object
40 41 42 43 44 45 46 |
# File 'app/components/flowbite/sidebar.rb', line 40 def call content_tag(:aside, ) do content_tag(:div, class: wrapper_classes) do content end end end |