PHP Classes

File: site/components/tabs.md

Recommend this page to a friend!
  Packages of Boss Ibrahim Mussa   Caelrik   site/components/tabs.md   Download  
File: site/components/tabs.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Caelrik
Build Web user interface from PHP components
Author: By
Last change:
Date: 8 days ago
Size: 968 bytes
 

 

Contents

Class file image Download

Tabs

Bootstrap 5 tabs following the WAI-ARIA tabs pattern.

<Demo name="tabs" />

<<< @/demos/tabs.php

Options

| Method | Use | |---|---| | tab($id, $label, $content) | A tab and its panel. Content is text (escaped) or a Stringable: another component, Html::raw(). | | label($label) | The tab list's accessible name, e.g. "Account settings". | | active($id) | The tab selected first (default: the first one). | | style('tabs' \| 'pills' \| 'underline'), fill() | Look, and tabs sharing the full width. | | rememberInHash() | Keeps the selected tab in the URL hash (#security), so links and reloads open it. |

Accessibility

tablist, tab and tabpanel roles with aria-controls, aria-selected and aria-labelledby. Left and Right arrows, Home and End move between tabs, and only the selected tab is in the Tab order. Bootstrap's JavaScript (bootstrap.bundle.js) switches the panels: without it only the selected panel is shown.