Skip to content
coatx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Tabs

Pill-style and underline-style tabbed navigation lists, tabs, and panels.

colors is not defined

Usage

import { Tabs, TabsList, TabsPanel, TabsTab } from "@ilha/ui-sdk/tabs";
import { tabs, tabsList, tabsPanel, tabsTab } from "coatx/tabs";

export const SettingsTabs = () => (
  <Tabs defaultValue="general" {...tabs()}>
    <TabsList {...tabsList({ variant: "line" })}>
      <TabsTab
        value="general"
        class={(s) => tabsTab({ selected: s.selected, variant: "line" }).class}
      >
        General
      </TabsTab>
    </TabsList>
    <TabsPanel value="general" {...tabsPanel()}>
      General settings
    </TabsPanel>
  </Tabs>
);

Exports (coatx/tabs)

Export Description
tabs(options?) Tabs root container
tabsList(options?) Tab bar container (default or line)
tabsTab(options?) Individual tab button
tabsPanel(options?) Tab panel body
tabsStyles Compiled StyleX style map

Options

Option Type Default
variant "default", "line" "default"
selected boolean (tab) false
orientation "horizontal", "vertical" (root) "horizontal"

Was this page helpful?