Skip to main content
Use TabButton for route links and actions such as adding a tab or opening an overflow menu. It shares the appearance of Tabs and uses Button for interaction.

Usage

State and semantics

Your application supplies active from its current route or menu state. This prop highlights the control. Set aria-current="page" on the current route link. Route links and adjacent actions retain their link or button semantics, with no tab role, aria-selected, or panel relationship. Use Tabs.Root, Tabs.List, Tabs.Tab, Tabs.Panel, and optional Tabs.Indicator to switch between related content panels. Keep route and action controls outside Tabs.List. Set href to render a native link. The current route owns its active appearance and aria-current value.
For client-side routing, supply your router link through render, set nativeButton={false} and role="link", and pass the resolved destination as href. Keep route state and history options on the router link. Custom wrappers must forward the supplied props and ref to their anchor.
An explicit nativeButton controls the interaction contract even when href is present. Match it to the actual rendered element. Disabled links retain their link role and block activation.

Actions

Without href, the control renders a native button with type="button". Native attributes, refs, styles, class names, and event handlers pass through. render accepts an element or a function receiving the Button props and state. Refs point to the actual rendered button or anchor, including refs supplied on a composed element.
Use startIcon, endIcon, and badge for supporting content. An avatar passed to an icon slot is decorative when the text names the destination. size retains the public Button size contract. An explicit size takes priority over a surrounding ButtonGroup size; otherwise the component defaults to sm.

Props

boolean
default:"false"
Highlights the current destination or an action associated with the active tab. Does not change the control role.
ReactNode
Content following the label and trailing icon, such as a count.
string | ((state: ButtonState) => string | undefined)
CSS class applied to the element, or a function that returns a class based on the component’s state.
ReactNode
Decorative content displayed after the label.
boolean
default:"false"
Whether the button should be focusable when disabled.
string
Destination URL. Renders a native anchor when render is omitted unless nativeButton is explicitly true. Custom renderers retain their own element contract.
boolean
default:"true"
Whether the rendered root is a native button. Defaults to true for custom renderers. The built-in href anchor defaults to false; an explicit value takes precedence.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>
Caller-supplied root element or renderer. Native attributes, handlers, event details, and refs reach the rendered root. Use nativeButton={false} and role="link" for a custom navigation anchor. Router integration belongs to the caller.
AriaRole
Role of the root element. Use link for custom navigation renderers.
"md" | "sm"
default:"sm"
Padding of the tab content: sm or md. Explicit size takes precedence over the ButtonGroup size, then sm applies.
ReactNode
Decorative content displayed before the label.
CSSProperties | ((state: ButtonState) => CSSProperties | undefined)
Style applied to the element, or a function that returns a style object based on the component’s state.