Tab item component for dashboard navigation.
Renders individual tabs with support for:
- Icons and labels
- Badges and indicators
- Active state highlighting
- Attention animations
- External links
- Tooltips
- Presence indicators
Summary
Functions
Renders a mobile-friendly tab item for bottom navigation.
Checks if a path already contains a locale prefix (e.g., /uk/, /en/, /zh-Hans/). Returns true if the path starts with a locale pattern.
Renders the inner content of a tab (icon, label, badge, presence).
Renders a dashboard tab item.
Functions
Renders a mobile-friendly tab item for bottom navigation.
Attributes
tab(:any) (required)active(:boolean) - Defaults tofalse.locale(:string) - Defaults tonil.class(:string) - Defaults to"".
Checks if a path already contains a locale prefix (e.g., /uk/, /en/, /zh-Hans/). Returns true if the path starts with a locale pattern.
Renders the inner content of a tab (icon, label, badge, presence).
Attributes
tab(:any) (required)active(:boolean) - Defaults tofalse.viewer_count(:integer) - Defaults to0.compact(:boolean) - Defaults tofalse.is_subtab(:boolean) - Defaults tofalse.subtab_style(:map) - Defaults to%{}.
Renders a dashboard tab item.
Attributes
tab- The Tab structactive- Whether this tab is currently activeviewer_count- Number of users viewing this tab (optional)locale- Current locale for path generationcompact- Render in compact mode (icon only)class- Additional CSS classes
Examples
<.tab_item tab={@tab} active={@tab.active} />
<.tab_item tab={@tab} active={true} viewer_count={3} />Attributes
tab(:any) (required)active(:boolean) - Defaults tofalse.viewer_count(:integer) - Defaults to0.locale(:string) - Defaults tonil.compact(:boolean) - Defaults tofalse.class(:string) - Defaults to"".parent_tab(:any) - Defaults tonil.