Glide Tabs

An animated tab group component for React.

Installation

npm install glide-tabs motion

Usage

import { TabGroup, Tab } from 'glide-tabs';
import 'glide-tabs/styles.css';

function App() {
  const [active, setActive] = useState('overview');

  return (
    <TabGroup value={active} onChange={setActive}>
      <Tab value="overview">Overview</Tab>
      <Tab value="features">Features</Tab>
      <Tab value="pricing">Pricing</Tab>
    </TabGroup>
  );
}

Variants

Switch between pill and underline styles.

Scrollable

Set a maxWidth to enable horizontal scrolling when tabs overflow.

Scroll horizontally to see more tabs

API

<TabGroup>

PropTypeDefaultDescription
valuestringActive tab value (controlled)
onChange(value: string) => voidCalled when a tab is clicked
variant"pill" | "underline""pill"Visual style of the indicator
maxWidthnumber | stringMax width before scrolling
classNamestringCustom class on the container
styleCSSPropertiesInline style overrides

<Tab>

PropTypeDefaultDescription
valuestringUnique tab identifier
disabledbooleanfalseDisables the tab
classNamestringCustom class on the tab button
childrenReactNodeTab label content