Noora.Sidebar (noora v0.4.0)
A flexible sidebar.
Example
<.sidebar>
<.sidebar_item
label="Dashboard"
icon="home"
patch={~p"/dashboard"}
selected={@live_action == :dashboard}
/>
<.sidebar_group
id="products-group"
label="Products"
icon="package"
collapsible={true}
default_open={true}
>
<.sidebar_item
label="All Products"
icon="list"
patch={~p"/products"}
/>
<.sidebar_item
label="Add Product"
icon="plus"
patch={~p"/products/new"}
/>
</.sidebar_group>
</.sidebar>
Summary
Functions
Slots
inner_block
(required)
Attributes
id
(:string
) (required)icon
(:string
) (required) - The icon of the group.label
(:string
) (required) - The label of the group.collapsible
(:boolean
) - Whether the group is collapsible. Defaults totrue
.default_open
(:boolean
) - Whether the group is open by default. Defaults tofalse
.navigate
(:string
) - Navigates to a LiveView. Defaults tonil
.patch
(:string
) - Patches the current LiveView. Defaults tonil
.href
(:any
) - Uses traditional browser navigation to the new location. Defaults tonil
.selected
(:boolean
) - Whether the item is selected. Defaults tofalse
.disabled
(:boolean
) - Whether the item is disabled. Defaults tofalse
.- Global attributes are accepted.
Slots
inner_block
Attributes
label
(:string
) (required) - The label of the item.icon
(:string
) (required) - The icon of the item.selected
(:boolean
) - Whether the item is selected. Defaults tofalse
.navigate
(:string
) - Navigates to a LiveView. Defaults tonil
.patch
(:string
) - Patches the current LiveView. Defaults tonil
.href
(:any
) - Uses traditional browser navigation to the new location. Defaults tonil
.- Global attributes are accepted.