0.1.7 • Published 2 years ago

ztabs v0.1.7

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

GitHub last commit npm beta

ztabs

a simple tab test project

Expected screen output

Getting Started

$ npm install --save ztabs

or

$ yarn add ztabs

Usage

import Tab from "ztabs";

...

<Tab initialActive={0}>
  <Tab.Pane title="First Tab">
    Tab 0
  </Tab.Pane>
  <Tab.Pane title="Second Tab">
    <div>
      Tab <strong>1</strong>
    </div>
  </Tab.Pane>
  <Tab.Pane title="Third Tab">
    <>
      <h2>Tab</h2>
      <span>2</span>
    </>
  </Tab.Pane>
</Tab>

Options and examples

Tab

initialActive (uncontrolled mode): zero-based index of the default active tab.
Tab changes will be handled by Tab

  <Tab initialActive={0}>

active (controlled mode): zero-based index of the currently active tab.
Tab changes will be controlled by this {value} through onActiveChange

  <Tab active={value}>

onActiveChange (controlled mode): event handler function called upon tab click

  <Tab active={value} onActiveChange={(event: React.MouseEvent<HTMLButtonElement>) => setValue(+event.currentTarget.value)} >

Tab.Pane

title: Tab name

<Tab.Pane title="MyTab" >

<children/>: Tab content

<Tab.Pane title="MyTab" >
    <div>Tab Content</div>
</Tab.Pane>

Credits

TODO: Write credits :)

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

MIT License © zeonardo 2022

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago