mui / mui/base-ui

[tabs] Add keepMounted prop to Tabs.Root for consistency with Accordion.Root

Open
#4,822 0 comments 1 reaction 0 assignees View on GitHub
component: tabs type: enhancement
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

## Summary

Add a `keepMounted` prop to `Tabs.Root` for consistency with `Accordion.Root`.

`Tabs.Panel` already supports `keepMounted`, but there is no way to set it once for all panels from `Tabs.Root`.

## Motivation

This mainly improves API consistency between Accordion and Tabs.

Today, users can write ``, but need to repeat `keepMounted` on every `Tabs.Panel`. A root-level prop would make Tabs match Accordion and provide a convenient default for preserving panel state, avoiding remounts, and supporting measured or animated panel content.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.