PhoenixKitWeb.Components.AdminNav (phoenix_kit v1.5.2)

View Source

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

Summary

Functions

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

Renders an icon for admin navigation items.

Renders an admin navigation item with proper active state styling.

Renders theme controller for admin panel. Based on EZNews theme system with DaisyUI integration.

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

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/dashboard")}
  icon="dashboard"
  label="Dashboard"
  current_path={Routes.locale_aware_path(assigns,"/admin/dashboard")}
/>

<.admin_nav_item
  href={Routes.locale_aware_path(assigns,"/admin/users")}
  icon="users"
  label="Users"
  current_path={Routes.locale_aware_path(assigns,"/admin/dashboard")}
  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.

admin_theme_controller(assigns)

Renders theme controller for admin panel. Based on EZNews theme system with DaisyUI integration.

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.