Tabs

Tabs organize content across different screens and views

Usage

Tabs organize content across different views. Use Tabs with Tab children.

import { Tabs, Tab } from "@udixio/ui-react"

Variants

  • primary (default)
  • secondary

Controlled selection and scrollable

Use selectedTab and setSelectedTab for controlled state. Set scrollable to true to enable horizontal scroll with automatic centering of the selected tab.

Tab panels with TabGroup

Use TabGroup to connect Tabs with TabPanels. This provides flexibility to place panels anywhere and includes a slide animation.

import { TabGroup, Tabs, Tab, TabPanels, TabPanel } from "@udixio/ui-react"

Flexible layout with TabGroup

Since TabGroup uses context, you can place Tabs and TabPanels anywhere within the group.

Controlled TabGroup

Control the selected tab externally via selectedTab and setSelectedTab props on TabGroup.

Children as label

You can use children as an alternative to the label prop when providing a string.

If the href prop is provided on a Tab, it renders an <a> link; otherwise it renders a <button>.