Open
Conversation
Contributor
Author
|
/review |
commit: |
victornguyen
approved these changes
Mar 30, 2026
docs/components/tabs.md
Outdated
| | --------------- | ---------------------------- | -------------- | --------------------------------------- | | ||
| | `defaultValue` | `Tabs.Tab.Value` | `0` | Initial active tab value (uncontrolled) | | ||
| | `value` | `Tabs.Tab.Value` | - | Controlled active tab value | | ||
| | `onValueChange` | `(value: any) => void` | - | Callback when the active tab changes | |
There was a problem hiding this comment.
Small bit from my review agent:
onValueChange docs show (value: any) => void but Base UI's actual signature is (value, eventDetails) => void. The second arg includes activationDirection and standard event details (reason, event, cancel()). Useful for transition animations or conditional side effects.
Contributor
Author
There was a problem hiding this comment.
Fixed — updated the docs table to reflect Base UI's actual signature: (value: Tabs.Tab.Value, eventDetails: Tabs.Root.ChangeEventDetails) => void, with a note about the activationDirection, event, reason, and cancel() fields in the second argument.
Commit: a1b2ecb
Apply Pick<> type narrowing to List, Tab, and Panel sub-components, matching the same pattern already used by Root. This prevents Base UI internal props from leaking into AppShell's public API surface.
Verify that a panel with keepMounted remains in the DOM even when its tab is not active.
f3d8e5a to
0daf45c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
Tabscompound component for tab-based navigation, backed by Base UI's Tabs primitive.Changes
New files
packages/core/src/components/tabs.tsx— Tabs compound component (Pattern B) withRoot,List,Tab,Panelsub-componentspackages/core/src/components/tabs.test.tsx— 9 tests (3 snapshot + 6 behavioral)docs/components/tabs.md— Component documentation.changeset/add-tabs-component.md— Minor changesetModified files
packages/core/src/index.ts— AddedTabsexportexamples/app-module/src/custom-module.tsx— Added Tabs demo to Primitive Components Demo pageUsage
Sub-components
Tabs.Rootvalue,defaultValue,onValueChange,orientation)Tabs.ListTabs.Tabvalueand optionaldisabledTabs.Panel