Tab and navigation components for Pure Admin.
Provides standalone tabs (tabs/1, tab_item/1, tab_panel/1) and
card tabs, with JS-command-based tab switching.
Summary
Functions
Returns a JS command that switches tab panels.
Renders an individual tab item/button.
Renders a tab panel (content for a single tab).
Renders a tab bar container.
Renders a bordered tabs container wrapper.
Renders a tab content container.
Renders a vertical tabs layout wrapper.
Functions
@spec switch_tab(String.t(), String.t() | nil, String.t() | nil) :: Phoenix.LiveView.JS.t()
Returns a JS command that switches tab panels.
Deactivates all sibling tabs and panels, then activates the target.
Renders an individual tab item/button.
Examples
<.tab_item target="panel-1" is_active>Home</.tab_item>
<.tab_item target="panel-2">
<:icon><i class="fa-solid fa-gear"></i></:icon>
Settings
</.tab_item>Attributes
target(:string) (required) - ID of the target tab panel.tabs_id(:string) - ID of the parent tabs container (for JS switching). Defaults tonil.is_active(:boolean) - Defaults tofalse.width(:string) - Fixed width. Defaults tonil. Must be one ofnil,"1x","2x","3x","4x","5x","6x","7x","8x","9x", or"10x".height(:string) - Fixed height. Defaults tonil. Must be one ofnil,"1x","2x","3x","4x","5x","6x","7x","8x","9x", or"10x".class(:string) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled"].
Slots
icon- Icon content (rendered before text).inner_block(required)
Renders a tab panel (content for a single tab).
Examples
<.tab_panel id="panel-1" is_active>Content here</.tab_panel>Attributes
id(:string) (required)is_active(:boolean) - Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Renders a tab bar container.
Examples
<.tabs id="my-tabs">
<.tab_item target="panel-1" is_active>Overview</.tab_item>
<.tab_item target="panel-2">Details</.tab_item>
</.tabs>
<.tabs_content>
<.tab_panel id="panel-1" is_active>Overview content</.tab_panel>
<.tab_panel id="panel-2">Details content</.tab_panel>
</.tabs_content>Attributes
id(:string) - Defaults tonil.style(:string) - Tab style variant. Defaults tonil. Must be one ofnil,"pills","boxed","border-top", or"vertical".is_border_top(:boolean) - Border on top instead of bottom (shorthand for style='border-top'). Defaults tofalse.size(:string) - Defaults tonil.Must be one ofnil,"sm", or"lg".align(:string) - Defaults tonil.Must be one ofnil,"centered", or"full".overflow(:string) - Defaults tonil.Must be one ofnil,"nowrap","scrollable", or"collapse".class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Renders a bordered tabs container wrapper.
Attributes
is_bordered(:boolean) - Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Renders a tab content container.
Attributes
id(:string) - Content container ID (use {tabs_id}-content for scoped switching). Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Renders a vertical tabs layout wrapper.
Attributes
is_bordered(:boolean) - Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)