microsoft / fluentui-contrib

Monorepo for contributor extension packages to Fluent UI
MIT License
31 stars 35 forks source link

feat(react-interactive-tab): InteractiveTab component initial implementation #217

Closed dmytrokirpa closed 1 month ago

dmytrokirpa commented 3 months ago

Context

Previously, TabList was unable to support interactive tabs, such as tabs with a dismiss/close button to remove them, or tabs that included a dropdown or search box.

The primary slot for a Tab was a button designated with role=tab. Per ARIA guidelines, elements with role=tab are expected to only contain presentational children.

New Behavior

This PR introduces the InteractiveTab component, which is an extension of Tab, utilizing a div as its base. It features three additional slots: button (where role=tab is applied), beforeContent, and afterContent. This structure, reminiscent of the Input component, permits the insertion of interactive elements both before and after the tab button.

The InteractiveTab applies indicator styles to the root div and button styles to the button slot.

Related Issue(s)

Blocked by https://github.com/microsoft/fluentui/pull/32125 Addresses issue #32078