Search documentation of phoenix_kit

# PhoenixKitWeb.Components.AdminNav (phoenix_kit v1.7.87)

Copy Markdown View Source

Admin navigation components for the PhoenixKit admin panel. Provides consistent navigation elements for both desktop sidebar and mobile drawer.

## Summary

### Functions

admin_language_dropdown(assigns)

Renders language dropdown for top bar navigation. Shows globe icon with dropdown menu for language selection.

admin_nav_icon(assigns)

Renders an icon for admin navigation items.

admin_nav_item(assigns)

Renders an admin navigation item with proper active state styling.

admin_theme_controller(assigns)

Renders theme controller for admin panel. Uses the shared theme_controller component with all themes.

admin_user_dropdown(assigns)

Renders user dropdown for top bar navigation. Shows user avatar with dropdown menu containing email, role, settings and logout.

admin_user_info(assigns)

Renders user information section for admin panel sidebar. Shows current user email and role information.

## Functions

# admin_language_dropdown(assigns)

Renders language dropdown for top bar navigation. Shows globe icon with dropdown menu for language selection.

## Attributes

- `current_path` (`:string`) - Defaults to `""`.
- `current_locale` (`:string`) - Defaults to `"en"`.

# admin_nav_icon(assigns)

Renders an icon for admin navigation items.

## Attributes

- `icon` (`:string`) (required)
- `active` (`:boolean`) - Defaults to `false`.

# admin_nav_item(assigns)

Renders an admin navigation item with proper active state styling.

## Examples

    <.admin_nav_item
      href={Routes.locale_aware_path(assigns,"/admin")}
      icon="dashboard"
      label="Dashboard"
      current_path={Routes.locale_aware_path(assigns,"/admin")}
    />

    <.admin_nav_item
      href={Routes.locale_aware_path(assigns,"/admin/users")}
      icon="users"
      label="Users"
      current_path={Routes.locale_aware_path(assigns,"/admin")}
      mobile={true}
    />

## Attributes

- `href` (`:string`) (required)
- `icon` (`:string`) (required)
- `label` (`:string`) (required)
- `description` (`:string`) - Defaults to `nil`.
- `current_path` (`:string`) (required)
- `mobile` (`:boolean`) - Defaults to `false`.
- `nested` (`:boolean`) - Defaults to `false`.
- `disable_active` (`:boolean`) - Defaults to `false`.
- `exact_match_only` (`:boolean`) - Defaults to `false`.
- `submenu_open` (`:boolean`) - Defaults to `false`.

# admin_theme_controller(assigns)

Renders theme controller for admin panel. Uses the shared theme_controller component with all themes.

## Attributes

- `mobile` (`:boolean`) - Defaults to `false`.

# admin_user_dropdown(assigns)

Renders user dropdown for top bar navigation. Shows user avatar with dropdown menu containing email, role, settings and logout.

## Attributes

- `scope` (`:any`) - Defaults to `nil`.
- `current_path` (`:string`) - Defaults to `""`.
- `current_locale` (`:string`) - Defaults to `"en"`.

# admin_user_info(assigns)

Renders user information section for admin panel sidebar. Shows current user email and role information.

## Attributes

- `scope` (`:any`) - Defaults to `nil`.