<divclass="rvt-tabs"data-rvt-tabs="tabset-1"> <divclass="rvt-tabs__tablist"aria-label="Rivet tabs"data-rvt-tablist> <buttonclass="rvt-tabs__tab"data-rvt-tab>Tab one</button> <buttonclass="rvt-tabs__tab"data-rvt-tab>Tab two</button> <buttonclass="rvt-tabs__tab"data-rvt-tab>Tab three</button> <buttonclass="rvt-tabs__tab"data-rvt-tab>Tab four</button> </div> <divclass="rvt-tabs__panel"data-rvt-tab-panel> <spanclass="rvt-ts-23 rvt-text-bold">Become the best version of yourself at IU</span> <p> Develop the skills you need for a rewarding career, and follow in the footsteps of more than 729,000 IU alumni who are leading organizations, innovating the future, and making an impact on their communities and the world. </p> </div> <divclass="rvt-tabs__panel"data-rvt-tab-panel> <spanclass="rvt-ts-23 rvt-text-bold">Find your calling</span> <p> IU offers more than 2,300 different programs of study. Not sure what to focus on? No problem. Browse by interest area to find options you'd enjoy pursuing. </p> </div> <divclass="rvt-tabs__panel"data-rvt-tab-paneldata-rvt-tab-init> <spanclass="rvt-ts-23 rvt-text-bold">Pursue your passion or explore the possibilities</span> <p> From nursing to criminal justice, epidemiology to environmental science, social work to cybersecurity, and more than 900 academic programs in between, IU gives you the power to study whatever sparks your interest, with the support of world-class professors and faculty who care about your success. </p> </div> <divclass="rvt-tabs__panel"data-rvt-tab-panel> <spanclass="rvt-ts-23 rvt-text-bold">Find your ideal campus life at IU</span> <p> Each of our nine campuses offers a welcoming, inclusive environment that feels like home, whatever your background, interests, or goals. Whether you want a Big Ten college experience, the dynamic pace of an urban research university, the community feeling of a regional campus close to home, or the flexibility of a fully online degree program, you’ll find it at IU. </p> </div> </div>
<divclass="rvt-tabs"data-rvt-tabs="tabset-1"> <divclass="rvt-tabs__tablist"aria-label="Rivet tabs"data-rvt-tablist> <buttonclass="rvt-tabs__tab"data-rvt-tab>Tab one</button> <buttonclass="rvt-tabs__tab"data-rvt-tab="example-tab">Tab two</button> <buttonclass="rvt-tabs__tab"data-rvt-tab>Tab three</button> <buttonclass="rvt-tabs__tab"data-rvt-tab>Tab four</button> </div> <divclass="rvt-tabs__panel"data-rvt-tab-panel> <spanclass="rvt-ts-23 rvt-text-bold">Become the best version of yourself at IU</span> <p> Develop the skills you need for a rewarding career, and follow in the footsteps of more than 729,000 IU alumni who are leading organizations, innovating the future, and making an impact on their communities and the world. </p> </div> <divclass="rvt-tabs__panel"data-rvt-tab-panel="example-tab"> <spanclass="rvt-ts-23 rvt-text-bold">Find your calling</span> <p> IU offers more than 2,300 different programs of study. Not sure what to focus on? No problem. Browse by interest area to find options you'd enjoy pursuing. </p> </div> <divclass="rvt-tabs__panel"data-rvt-tab-paneldata-rvt-tab-init> <spanclass="rvt-ts-23 rvt-text-bold">Pursue your passion or explore the possibilities</span> <p> From nursing to criminal justice, epidemiology to environmental science, social work to cybersecurity, and more than 900 academic programs in between, IU gives you the power to study whatever sparks your interest, with the support of world-class professors and faculty who care about your success. </p> </div> <divclass="rvt-tabs__panel"data-rvt-tab-panel> <spanclass="rvt-ts-23 rvt-text-bold">Find your ideal campus life at IU</span> <p> Each of our nine campuses offers a welcoming, inclusive environment that feels like home, whatever your background, interests, or goals. Whether you want a Big Ten college experience, the dynamic pace of an urban research university, the community feeling of a regional campus close to home, or the flexibility of a fully online degree program, you’ll find it at IU. </p> </div> </div>
Specifying tab IDs. By default, Rivet auto-generates tab and panel IDs. If you’d like a tab or panel to have a specific ID, you can explicitly set the data-rvt-tab and data-rvt-tab-panel attribute values in your markup. The attribute value for a given tab must match the attribute value of its associated panel. See the code examples on this page for guidance.
Do
Use to allow users to switch between related groups of content without refreshing the page
Use to present different views of the same data
Order tabs in way that makes sense for the content
Keep tab labels to 1–2 words
Don't
Stack multiple rows of tabs
Use all capital letters in tab labels
Include a "More" tab
Cause the page to refresh when the user switches tabs
Use when someone would need to compare data across tabs—use a table instead
Added to each button element with the data-rvt-tab attribute by the component’s JavaScript. Set to true if the associated panel is visible; false otherwise.
role="tablist"
Added to the element with the data-rvt-tablist element by the component’s JavaScript. Compatibility note: If this attribute is not found, the component JavaScript will infer where to place this attribute.
role="tab"
Added to each button element with the data-rvt-tab attribute by the component’s JavaScript.
role="tabpanel"
Added to each element with the data-rvt-tab-panel attribute by the component’s JavaScript.
aria-labelledby
Added to each element with the data-rvt-tab-panel attribute by the component’s JavaScript.
Activates the tab with the given data-rvt-tab-panel attribute value
addTab(label)
Adds a new tab with the given label. Also adds its associated panel. Returns an object with tab and panel properties that contain references to the added tab and panel respectively.
removeTab(idOrIndex)
Removes the tab at the given index or with the given data-rvt-tab attribute value. Also removes its associated panel.
Event
Description
Detail object properties
rvtTabActivated
Emitted when a tab is activated
tab: Reference to activated tab DOM element
rvtTabAdded
Emitted when a tab is added
tab: Reference to added tab DOM element
panel: Reference to added tab's associated panel DOM element
rvtTabRemoved
Emitted when a tab is removed
tab: Reference to removed tab DOM element
panel: Reference to removed tab's associated panel DOM element