rishav.raj
Thu Sep 14 2023
Headless UI Tab
Headless ui is providing us the Tab component were we have
Tab.Group
is the parent its wraps all this present inside it.Tab.list
in tab list we have defined ourtab
and we haveselected
as active tab.Tab.Panels
so tabs panels is the parent of all the Tab.Tab.Panel
so tab panel is defined under theTab.Panels
Note: if we have 3 tabs inTab.list
then we need to paced all 3Tab.Panel
in the same like we definetabs
inTab.List
example :
<Tab.Group>
<Tab.List>
<Tab
className={({ selected })} => // apply active class
key="must_pass_unique_key_1"
>
Tab Name 1
</Tab>
</Tab.List>
</Tab.Group>