@@ -3,7 +3,7 @@ import { Tabs as BaseTabs } from "@base-ui/react/tabs";
33
44import { cn } from "@/lib/utils" ;
55
6- // Only the props relevant to the Tabs abstraction are picked from BaseTabs.Root .
6+ // Only the props relevant to the Tabs abstraction are picked from Base UI .
77// Base UI-internal props are intentionally excluded so that upstream changes
88// don't leak as breaking changes to consumers.
99type RootProps = Pick <
@@ -40,8 +40,10 @@ function Root({ className, children, ...props }: RootProps) {
4040}
4141Root . displayName = "Tabs.Root" ;
4242
43+ type ListProps = Pick < React . ComponentProps < typeof BaseTabs . List > , "children" | "className" > ;
44+
4345/** Groups the individual tab buttons. */
44- function List ( { className, children, ...props } : React . ComponentProps < typeof BaseTabs . List > ) {
46+ function List ( { className, children, ...props } : ListProps ) {
4547 return (
4648 < BaseTabs . List
4749 data-slot = "tabs-list"
@@ -57,8 +59,13 @@ function List({ className, children, ...props }: React.ComponentProps<typeof Bas
5759}
5860List . displayName = "Tabs.List" ;
5961
62+ type TabProps = Pick <
63+ React . ComponentProps < typeof BaseTabs . Tab > ,
64+ "value" | "disabled" | "children" | "className"
65+ > ;
66+
6067/** An individual interactive tab button that toggles the corresponding panel. */
61- function Tab ( { className, children, ...props } : React . ComponentProps < typeof BaseTabs . Tab > ) {
68+ function Tab ( { className, children, ...props } : TabProps ) {
6269 return (
6370 < BaseTabs . Tab
6471 data-slot = "tabs-tab"
@@ -78,8 +85,13 @@ function Tab({ className, children, ...props }: React.ComponentProps<typeof Base
7885}
7986Tab . displayName = "Tabs.Tab" ;
8087
88+ type PanelProps = Pick <
89+ React . ComponentProps < typeof BaseTabs . Panel > ,
90+ "value" | "keepMounted" | "children" | "className"
91+ > ;
92+
8193/** A panel displayed when the corresponding tab is active. */
82- function Panel ( { className, children, ...props } : React . ComponentProps < typeof BaseTabs . Panel > ) {
94+ function Panel ( { className, children, ...props } : PanelProps ) {
8395 return (
8496 < BaseTabs . Panel
8597 data-slot = "tabs-panel"
0 commit comments