Flowbite::Sidebar::Navigation
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.
Inside a Sidebar
<%= render(Flowbite::Sidebar.new) do %>
<%= render(Flowbite::Sidebar::Navigation.new) do |nav| %>
<% nav.with_item do %>
<%= render(Flowbite::Sidebar::Item.new(href: "/")) { "Home" } %>
<% end %>
<% end %>
<% end %>
Standalone
<%= render(Flowbite::Sidebar::Navigation.new) do |nav| %>
<% nav.with_item do %>
<%= render(Flowbite::Sidebar::Item.new(href: "/")) { "Home" } %>
<% end %>
<% end %>
API reference
Flowbite::Sidebar
Constructor
def initialize(class: nil, **options)
Parameters
class |
Array<String> | Additional CSS classes for the list element. |
|---|---|---|
options |
Hash | Additional HTML options for the list element. |
See also
Ruby API documentation forclass Flowbite::Sidebar::Navigation