DocSpace-client/packages/shared/components/tabs
2024-07-01 23:08:08 +07:00
..
hooks Shared:Components:Tabs: add custom scrollbar 2024-06-17 14:02:18 +07:00
data.tsx Shared:Components:Tabs: change data in storybook 2024-06-11 17:38:05 +07:00
index.tsx Shared:Components:Tabs: change import types 2024-06-17 16:58:31 +07:00
README.md Shared:Components:Tabs: add changes 2024-06-11 16:24:33 +07:00
Tabs.constants.ts Shared:Components:Tabs: add custom scrollbar 2024-06-17 14:02:18 +07:00
Tabs.enums.ts Shared:Components:Tabs: change prop ThemeTabs and imports 2024-06-13 22:02:13 +07:00
Tabs.stories.tsx Shared:Components:Tabs: change prop ThemeTabs and imports 2024-06-13 22:02:13 +07:00
Tabs.styled.ts Shared:Components:Tabs: change colors in active tabs 2024-07-01 23:08:08 +07:00
Tabs.tets.tsx Shared:Components:Tabs: add changes to tests 2024-06-13 20:35:21 +07:00
Tabs.tsx Shared:Components:Tabs: add custom scrollbar 2024-06-17 14:02:18 +07:00
Tabs.types.ts Shared:Components:Tabs: change prop ThemeTabs and imports 2024-06-13 22:02:13 +07:00

Tabs

Usage

import { Tabs } from "@docspace/shared/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

Props Type Required Values Default Description
items array - - Child elements
selectedItemId number, string - - - Selected item id of tabs
theme primary, secondary - - primary Theme for displaying tabs
stickyTop string - - - Tab indentation for sticky positioning
onSelect func - - - Sets a callback function that is triggered when the tab is selected

Array Items Properties

Props Type Required Values Default Description
id string - - Index of object array
name string - - Tab text
content node - - Content in Tab
isDisabled boolean - - - State of tab inclusion. State only works for tabs with a secondary theme
onClick func - - - Triggered when a title is selected