Tab

A tab inside Tabs or a standalone navigation item.

label sets the caption, active marks selection, and href makes it a link. theme sets the appearance (line, pill, pill-secondary), and badge adds a badge after the label.

Live example

Example controls

Usage

import { Tab } from '@prosazhin/pbcomponents';

<Tab
  label='Tab'
  active={false}
/>;

Component API

PropType / variantsPurposeDefault
labelstringTab label.—
activebooleanActive state of a standalone tab.false
indicatorbooleanLine below the active tab.true
theme'line' | 'pill' | 'pill-secondary'line · pill · pill-secondaryTab appearance.line
badgeReactElement<BadgeProps>Badge to the right of the label.—
disabledbooleanDisables interaction.false
leftIconSvgTypenone · check · search · userIcon before the text; accepts an SVG component.—
rightIconSvgTypenone · check · search · userIcon after the text; accepts an SVG component.—
leftIconClassNamestringClass of the left icon.—
rightIconClassNamestringClass of the right icon.—
onClick(event) => voidTab click handler.—
hrefstringRenders a link instead of a button.—
linkComponentElementTypeCustom link component, such as Next.js Link.—
target'_self' | '_blank'_self · _blankWhere to open the link._self
type'button' | 'reset' | 'submit'button · reset · submitHTML button type.button
classNamestringClass of the root element.—
textClassNamestringClass of the text part.—

Native HTML attributes are accepted where the component renders the corresponding element. className props only affect styling.