--- layout: layouts/component.njk title: Tabs description: A set of layered sections of content—known as tab panels—that are displayed one at a time. toc: - label: Usage id: usage --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% from "components/tabs.njk" import tabs %} {% set code %} {% set account_panel %}

Account

Make changes to your account here. Click save when you're done.

{% endset %} {% set password_panel %}

Password

Change your password here. After saving, you'll be logged out.

{% endset %} {% set tabsets_demo = [ { tab: "Account", panel: account_panel }, { tab: "Password", panel: password_panel } ] %} {{ tabs( id='demo-tabs-with-panels', tabsets=tabsets_demo, main_attrs={ "class": "w-full" }, tablist_attrs={ "class": "w-full" } ) }} {% endset %} {{ code_preview("tabs", code | prettyHtml, "max-w-[300px] w-full") }}

Usage

You can style an <input type="range"> element by either adding the input class or having a parent with the form class (read more about form). However, the range input also requries some Javacript code to be able to paint the left side of the slider.

{{ code_block(code) }}