@pikas-ui/tabs

This package contains a tabs component that can be used to switch between different views.

This library is based on Radix Ui.

Change Log

Requirements

To use this package, you must install the @pikas-ui/styles package.

Installation

You can install this package using npm, yarn, or pnpm.

npm install @pikas-ui/tabs
yarn add @pikas-ui/tabs
pnpm add @pikas-ui/tabs

Usage

Tabs

This component is used to create a tabs component.

Tab 1 content
import { Tabs } from '@pikas-ui/tabs';

const Example: React.FC = () => {
  return (
    <Tabs
      items={[
        {
          content: 'Tab 1 content',
          trigger: 'Tab 1',
          id: 'tab1',
        },
        {
          content: 'Tab 2 content',
          trigger: 'Tab 2',
          id: 'tab2',
        },
        {
          content: 'Tab 3 content',
          trigger: 'Tab 3',
          id: 'tab3',
          disabled: true,
        },
      ]}
      defaultValue="tab1"
    />
  );
};

Props

PropDescriptionTypeDefault
itemsArray of tabs itemsTabsItem[]-
defaultValueDefault value of the tabsstring-
valueValue of the tabsstring-
onValueChangeCallback function that is called when the value of the tabs changes(value: string) => void-
orientationOrientation of the tabsTabsOrientationvertical
directionDirection of the tabsTabsDirectionltr
activationModeActivation mode of the tabsTabsActivationMode-
loopWhether the tabs should loopboolean-
cssCustom cssTabsCSS-
paddingPadding of the tabsTabsPadding{ trigger: 'md', content: 'md' }
alignmentTriggerAlignment of the triggerTabsAlignmentTriggerstretch
startTriggerStart custom element of the triggerReactNode-
endTriggerEnd custom element of the triggerReactNode-

Contributing

This documentation can be edited on GitHub here