# Tabs Component  ## Usage ```javascript import { Tabs } from "tailwindcss-stimulus-components" application.register('tabs', Tabs) ``` ```html
``` `data-tabs-target="tab"` defines which element is marked as a tab. The index of the tab is used to determine which panel to make visible. `data-tabs-target="panel"` defines which panel is visible based upon the currently selected tab. `data-tabs-active-tab-class` defines the list of classes that will be added/removed from the active tab when the active tab changes. `data-tabs-inactive-tab-class` defines the list of classes that will be added/removed from the inactive tab when the active tab changes. `data-tabs-index-value="1"` can be used to set the selected tab when the controller connects. `data-tabs-update-anchor-value="true"` can be used to update the URL anchor when the tab changes. ##### Changing tabs from other places If you'd like to change the tab from a button or link outside of the tabs, you can call the same method and assign either `data-id` or `data-index` to select the tab. ```html Change tab by data-index Change tab by data-id ```