2.1.0 • Published 8 years ago

deku-tab-control v2.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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.

2.1.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago