Keyboard-friendly schema tabs, plus tabPanels(false)

Keyboard-friendly schema tabs, plus tabPanels(false)

  • accessibility
  • keyboard
  • screen-reader
PR #20682 by @danharrin

Schema Tabs now work properly with the keyboard.

Arrow keys move between tabs (up and down for vertical tabs, and right-to-left layouts are handled), Home and End jump to the first and last tab, and Enter or Space selects.

Tabs that overflow into the "More tabs" dropdown are included, and the dropdown opens when focus reaches them.

The new tabPanels(false) mode is for tabs that only switch a Livewire property, like a filter, without showing content panels.

Resource list tabs now use it automatically.

A good fit is a status filter strip above a custom Livewire list that screen readers announce properly.

Tabs::make('Status')
    ->livewireProperty('activeStatus')
    ->tabPanels(false)
    ->tabs([
        'all' => Tab::make('All'),
        'published' => Tab::make('Published'),
    ])
All Filament Up To Date tips