UNPKG

@wordpress/components

Version:
42 lines 1.24 kB
/// <reference types="react" /> import type { TabPanelProps } from './types'; import type { WordPressComponentProps } from '../ui/context'; /** * TabPanel is an ARIA-compliant tabpanel. * * TabPanels organize content across different screens, data sets, and interactions. * It has two sections: a list of tabs, and the view to show when tabs are chosen. * * ```jsx * import { TabPanel } from '@wordpress/components'; * * const onSelect = ( tabName ) => { * console.log( 'Selecting tab', tabName ); * }; * * const MyTabPanel = () => ( * <TabPanel * className="my-tab-panel" * activeClass="active-tab" * onSelect={ onSelect } * tabs={ [ * { * name: 'tab1', * title: 'Tab 1', * className: 'tab-one', * }, * { * name: 'tab2', * title: 'Tab 2', * className: 'tab-two', * }, * ] } * > * { ( tab ) => <p>{ tab.title }</p> } * </TabPanel> * ); * ``` */ export declare function TabPanel({ className, children, tabs, selectOnMove, initialTabName, orientation, activeClass, onSelect, }: WordPressComponentProps<TabPanelProps, 'div', false>): JSX.Element; export default TabPanel; //# sourceMappingURL=index.d.ts.map