defmodule Shino.UI.VerticalNav do
@moduledoc """
Provides vertical navigation related components.
## Examples
```heex
<.icon name="hero-home" class="mr-2 h-4 w-4" /> Overview
<.icon name="hero-chart-pie" class="mr-2 h-4 w-4" /> Income
<.icon name="hero-device-phone-mobile" class="mr-2 h-4 w-4" /> APP Versions
<.icon name="hero-chevron-down" class="ml-auto h-4 w-4" />
iOS APP Versions
Android APP Versions
```
"""
use Shino.UI, :component
@doc """
The root contains all the parts of a collapsible.
"""
attr :class, :any, default: nil
attr :rest, :global
slot :inner_block, required: true
def root(assigns) do
~H"""
"""
end
@doc """
Renders a sidebar group.
"""
attr :class, :any, default: nil
attr :rest, :global
slot :inner_block, required: true
def group(assigns) do
~H"""
<%= render_slot(@inner_block) %>
"""
end
@doc """
Renders a sidebar sub_group.
"""
attr :class, :any, default: nil
attr :rest, :global
slot :inner_block, required: true
def sub_group(assigns) do
~H"""
<%= render_slot(@inner_block) %>
"""
end
@doc """
Renders a sidebar item.
"""
attr :class, :any, default: nil
attr :active, :boolean, default: false
attr :rest, :global
slot :inner_block, required: true
def item(assigns) do
~H"""
<%= render_slot(@inner_block) %>
"""
end
@doc """
Renders a sidebar plain.
It should be used with ``.
"""
attr :class, :any, default: nil
attr :rest, :global
slot :inner_block, required: true
def plain(assigns) do
~H"""
<%= render_slot(@inner_block) %>
"""
end
@doc """
Renders a sidebar anchor.
It should be used with ``.
"""
attr :class, :any, default: nil
attr :rest, :global, include: ~w(href navigate patch method)
slot :inner_block, required: true
def anchor(assigns) do
~H"""
<.link
class={
mc([
"w-full h-full px-3",
"inline-flex justify-start items-center",
@class
])
}
{@rest}
>
<%= render_slot(@inner_block) %>
"""
end
end