Tabs

Tabbed panels for organising content into switchable sections. Supports default, pills, and underline styles. Fully keyboard-navigable with ARIA roles.

Default Style

General settings content goes here.

With Badge Counts

Pending tasks.

Pills Style

Your inbox messages.

Underline Style

Overview panel.

PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->tabs($id)stringCreate a tabs component.
->tabStyle($style)stringSet tab style: default, pills, or underline.
->tab($key, $label)string, stringAdd a new tab panel. Returns self for chaining panel methods.
->icon($icon)stringSet icon on the current tab (chain after ->tab()).
->content($html)stringSet HTML content for the current tab panel.
->active()Mark the current tab as the active/default tab.
->disabled()Disable the current tab.
->remoteUrl($url)stringLoad tab content via AJAX on first activation.
->badge($key, $count)string, intAdd a badge count to a specific tab by key.

JS JS Methods

Method / PropertyParametersDescription
m.tabs(id)stringGet the tabs API for the given element ID.
selectTab(key)stringActivate a tab by its key.
setContent(key, html)string, stringReplace a tab panel's HTML content.
refreshContent(key, url, opts)string, string, ?objectFetch content from a URL and inject into the tab panel.
getActiveTab()Returns the key of the currently active tab.

EVENT Events

Event NameDetailDescription
m-tab-change{key, tab, panel}Fired when the active tab changes.
m-tab-content-loaded{key, panel}Fired when remote content finishes loading for the first time.
m-tab-content-refresh{key, panel}Fired when content is refreshed via refreshContent().