GWAN.DEV


Foundations

Icons

Actions

Buttons

Form Controls

Input

Text Area

Select Dropdown

Filter Dropdown

Checkbox

Radio Button

Switch

File Uploader

Color Picker

Multi Select

Search Input

Slider

OTP Input

Date Picker

Time Picker

Date Range Picker

Data Display

Table

Pagination

Progress Bar

Stat Card

Circular Progress

Navigation

Side Menu

Menu Bar

Tabs

Breadcrumb

Ellipsis

Content & Layout

Card

Divider

Banner

Carousel

Accordion

Timeline

Stepper

List

Overlays

Modal

Drawer

Popover

Command Palette

Dropdown Menu

Context Menu

Indicators

Tags

Chips

Badge

Avatar

Avatar Group

Tooltip

Skeleton

Spinner

Feedback

Snackbar

Alert

Callout

State

Tabs

Playground

Name, photo and bio.

Actions
  1. Interact with the preview to see callbacks fire.
Content
ITabItem[]

Tabs as { key, label, content, disabled? }. Content is rendered under the tab list.

Default—
string

Key of the selected tab. Defaults to the first one.

Default—
Appearance
TABS_VARIANT

Tab list style.

DefaultTABS_VARIANT.UNDERLINE
Events
(key: string) => void

Called with the key of the tab the user picks.

Default—
Logged in Actions
Advanced
string

Extra classes on the wrapper.

Default""
Usage
import { useState } from "react";
import { Tabs } from "gwan-design-system";

const items = [
  {
    key: "profile",
    label: "Profile",
    content: <p className="text-sm text-muted-fg py-4">Name, photo and bio.</p>,
  },
  {
    key: "security",
    label: "Security",
    content: <p className="text-sm text-muted-fg py-4">
      Password and two-factor settings.
    </p>,
  },
  {
    key: "billing",
    label: "Billing",
    content: <p className="text-sm text-muted-fg py-4">
      Plan, invoices and payment method.
    </p>,
  },
  {
    key: "api",
    label: "API",
    content: <p className="text-sm text-muted-fg py-4">
      Keys are available on paid plans.
    </p>,
    disabled: true,
  },
];

const Example = () => {
  const [activeKey, setActiveKey] = useState("profile");

  return (
    <Tabs
      items={items}
      activeKey={activeKey}
      onChange={setActiveKey}
    />
  );
};