PHP Classes

File: src/components/tab/Tab.stories.tsx

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WordPress React Plugin Kit   src/components/tab/Tab.stories.tsx   Download  
File: src/components/tab/Tab.stories.tsx
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WordPress React Plugin Kit
Environment to develop new WordPress plugins
Author: By
Last change:
Date: 2 years ago
Size: 884 bytes
 

Contents

Class file image Download
import { useState } from '@wordpress/element'; import { ComponentStory, ComponentMeta } from '@storybook/react'; import Tab from './Tab'; export default { title: 'Common/Tab', component: Tab, } as ComponentMeta<typeof Tab>; const Template: ComponentStory<typeof Tab> = (args) => <Tab {...args} />; const groupTabs = [ { title: 'All Carts', key: 'all', }, { title: 'Abandoned Carts', key: 'abandoned', }, { title: 'Recovered Carts', key: 'recovered', }, ]; export const ControlledTab = () => { const [activeTab, setActiveTab] = useState(groupTabs[0]); return ( <Tab groups={groupTabs} activeTab={activeTab} setActiveTab={setActiveTab} /> ); }; export const DefaultTab = Template.bind({}); DefaultTab.args = { groups: groupTabs, };