import * as React from "react";
import { TabTitle, Tabs, TabItem } from "../index";
import { TabsProps } from "../components/Tabs";
import { StoryFn, Meta } from "@storybook/react";
export default {
title: "Navigation/Tabs",
component: Tabs,
subcomponents: { Tabs, TabTitle, TabItem },
decorators: [Story =>
{Story()}
],
argTypes: {
direction: {
options: ["horiz", "vert"],
control: { type: "radio" }
},
onSelect: {
table: {
disable: true
}
},
selectedIndex: {
table: {
disable: true
}
}
}
} as Meta;
const Template: StoryFn = ({ direction, ...args }: TabsProps) => {
const [selectedIndex, setSelectedIndex] = React.useState(0);
return (
Tab 1
Tab content - Section 1.
Tab content - Section 2.
Tab 2
Tab content.
);
};
export const Default = {
render: Template,
args: { direction: "horiz" }
};
export const Responsive = {
render: Template,
args: {
direction: { medium: "vert" }
}
};