Profile panel components for Pure Admin.
Provides a slide-out profile panel with user info, avatar, navigation, and optional tabs/footer.
Summary
Functions
JS command to close the profile panel.
Renders a navigation item within the profile panel.
Renders a profile panel with overlay.
JS command to toggle the profile panel open/closed.
Functions
@spec close_profile_panel(String.t()) :: Phoenix.LiveView.JS.t()
JS command to close the profile panel.
Renders a profile panel with overlay.
Examples
<.profile_panel id="profile" name="John Doe" email="john@example.com" role="Admin">
<:nav>
<.profile_nav_item href="/profile" icon="fa-solid fa-user">Profile Settings</.profile_nav_item>
<.profile_nav_item href="/security" icon="fa-solid fa-lock">Security</.profile_nav_item>
</:nav>
<:footer_>
<button class="pa-btn pa-btn--danger pa-btn--block">Sign Out</button>
</:footer_>
</.profile_panel>Attributes
id(:string) - Defaults to"profile-panel".name(:string) (required) - User display name.email(:string) (required) - User email.role(:string) - User role badge text. Defaults tonil.has_avatar(:boolean) - Show avatar section. Defaults totrue.has_icon_only_tabs(:boolean) - Tabs show only icons. Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
avatar- Custom avatar content (default: user icon).tabs- Tabs section between header and body.nav- Navigation items in the body.actions- Action buttons in the body (deprecated, use footer_).footer_- Fixed footer content (e.g. sign out button).inner_block- Full body content (replaces nav+actions when using tabs).
@spec toggle_profile_panel(String.t()) :: Phoenix.LiveView.JS.t()
JS command to toggle the profile panel open/closed.