Use the Tabs component to separate sections within the same page, where each tab represents a different content area. Clicking on a tab displays the corresponding content while hiding the others.
Preview
Welcome to the documentation of Webcore.
To get started, run npm i webcoreui in your terminal.
You can use Webcore to rocket launch your frontend projects with fully coded components
The Tabs component expects an items prop. Each item must have a label and a value that must match one of the data-tab attributes. Optionally, you can set a tab as active using the active property. To also set the content as active, add a data-active attribute. Tabs can also be disabled using the disabled property in the items object:
Intro…
Setup…
…
Tabs with Icons
Tabs can also be created with icons by passing SVG elements as strings to the label properties. If you want to use icons from Webcore, you can import them from webcore/icons.
Intro…
Setup…
…
Themes
Tabs comes with two built-in themes: boxed and outline which can be controlled using the theme prop:
Vertical Tabs
Tabs can also be created using a vertical layout. Set the vertical prop to true to display tabs under each other.
Even Layout
By default, tabs only take up as much space as their label requires. This can be changed to make the tabs fill up the available space inside of its container by setting even to true:
API
Prop
Purpose
items.label
Sets the label of the tab.
items.value
Sets the value of the tab which references the content.
items.active
Sets the tab as the default active tab. Defaults to false.
items.disabled
Disables the tab, making it inactive. Defaults to false.
theme
Sets the theme of the Tabs component. Can be one of boxed, outline
vertical
Displayes the tabs in a vertical layout. Defaults to false.
even
Evenly distributes tabs to fill the available space. Defaults to false.