@codecraftkit
Documentation
The DataTabs is used to create a tabs using the component Tabs from Chakra ui, it is very easy and simple to use.
it can be imported from the core.
import { DataTabs } from "@codecraftkit/core";
or alone.
import DataTabs from "@codecraftkit/clickoutside";
The label will be placed in the tab title, and the content will be place inside the tab
function MyApp() {const [index,setIndex] = useState(0)const data = [{label: 'Chicken',content: <Animationautoplayloopname="chicken-70"height={200}width={200}/>},{label: 'Logo',content: <Animationautoplayloopname="instagram"height={200}width={200}/>},{label: 'Warning',content: <Animationautoplayloopname="alert-jumping"height={200}width={200}/>},];return <DataTabsdata={data}tabIndex={index}setTabIndex={setIndex}/>}
data
Array<object>
yes
Array of objects that will form each tab
styles
Object
no
To add some extra styles
variant
line
enclosed
enclosed-colored
soft-rounded
solid-rounded
unstyled
no
line
Change de visual style of the Tab
contentMinH
String
no
Min height of the tab
defaultIndex
Number
no
0
First tab index to be open when Tab Components render
tabIndex
State
yes
State to control the index
setTabIndex
Function
yes
Set index State
externalNav
Boolean
no
false
deactivate change tab by pressing tabs
fitted
Boolean
no
false
make tab fitted
...rest
chakra style props
no
It receives also every prop of Chakra-ui Tabs component