# `Noora.Sidebar`

A flexible sidebar.

## Example

```elixir
<.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>
```

# `sidebar`

## Attributes

* `id` (`:string`) - Defaults to `"sidebar"`.
## Slots

* `inner_block` (required)

# `sidebar_group`

## 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 to `true`.
* `default_open` (`:boolean`) - Whether the group is open by default. Defaults to `false`.
* `navigate` (`:string`) - Navigates to a LiveView. Defaults to `nil`.
* `patch` (`:string`) - Patches the current LiveView. Defaults to `nil`.
* `href` (`:any`) - Uses traditional browser navigation to the new location. Defaults to `nil`.
* `selected` (`:boolean`) - Whether the item is selected. Defaults to `false`.
* `disabled` (`:boolean`) - Whether the item is disabled. Defaults to `false`.
* Global attributes are accepted.
## Slots

* `inner_block`

# `sidebar_item`

## 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 to `false`.
* `navigate` (`:string`) - Navigates to a LiveView. Defaults to `nil`.
* `patch` (`:string`) - Patches the current LiveView. Defaults to `nil`.
* `href` (`:any`) - Uses traditional browser navigation to the new location. Defaults to `nil`.
* `external` (`:boolean`) - Whether the item points to an external resource. Defaults to `false`.
* Global attributes are accepted.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
