deku-tab-control

2.1.0 • Public • Published

deku-tab-control

Simple tab control component for deku.

Usage

npm install deku-tab-control
import TabControl from 'deku-tab-control';
 
export function render () {
  const items = [
    { text: 'Tab 1', content: <div>Tab 1 content</div> },
    { text: 'Tab 2', content: <div>Tab 2 content</div> },
    { text: 'Tab 3', content: <div>Tab 3 content</div> }
  ];
  // optional onChange event
  const onChange = ({ clickedIndex }) => {
    console.log(`you clicked index ${clickedIndex}`)
  };
 
  return <TabControl activeTabIndex={0} items={items} onChange={onChange} removeOnHide={true} />;
}
 

Attributes

activeTabIndex

Set initial active tab index

removeOnHide

If set to true, only the active tab content will be rendered. Defaults to show/hide with css.

Readme

Keywords

none

Package Sidebar

Install

npm i deku-tab-control

Weekly Downloads

1

Version

2.1.0

License

MIT

Last publish

Collaborators

  • ellell
  • iefserge
  • kesla
  • orrybaram