Tabs

January 27, 2026 · View on GitHub

Usage

import { Tabs } from "@docspace/ui-kit/components/tabs";
const array_items = [
  {
    id: "0",
    name: "Title1",
    content: (
      <div>
        <div>
          <button>BUTTON</button>
        </div>
        <div>
          <button>BUTTON</button>
        </div>
        <div>
          <button>BUTTON</button>
        </div>
      </div>
    ),
  },
  {
    id: "1",
    name: "Title2",
    content: (
      <div>
        <div>
          <label>LABEL</label>
        </div>
        <div>
          <label>LABEL</label>
        </div>
        <div>
          <label>LABEL</label>
        </div>
      </div>
    ),
  },
  {
    id: "2",
    name: "Title3",
    isDisabled: true,
    content: (
      <div>
        <div>
          <input></input>
        </div>
        <div>
          <input></input>
        </div>
        <div>
          <input></input>
        </div>
      </div>
    ),
  },
];
<Tabs items={array_items} />

Tabs Properties

PropsTypeRequiredValuesDefaultDescription
itemsarray--Child elements
selectedItemIdnumber, string--Selected item id of tabs
typeprimary, secondary--primaryTheme for displaying tabs
stickyTopstring---Tab indentation for sticky positioning
classNamestring---Sets a tab class name
onSelectfunc---Sets a callback function that is triggered when the tab is selected
withoutStickyIntendboolean---Disables sticky indent
styleobject---Accepts css style
layoutIdstring---If set, this component will animate changes to its layout. Additionally, when a new element enters the DOM and an element already exists with a matching layoutId, it will animate out from the previous element's size/position
isLoadingboolean---Is loading
scaledboolean---Scales tabs to container width
hotkeysIdstring---Unique identifier for hotkey functionality
idstring---Element id
withAnimationboolean---Enables animation for tab transitions

Array Items Properties

PropsTypeRequiredValuesDefaultDescription
idstring--Index of object array
namestring, ReactNode--Tab text
contentReactNode--Content in Tab
isDisabledboolean---State of tab inclusion. State only works for tabs with a secondary theme
onClickfunc---Triggered when a title is selected
badgeReactNode---Badge shown after tab. Only for primary tabs type
valuenumber---Numeric value
iconNamestring---Icon name. Only for secondary tabs type