{#- chirp-ui: Tab panels (button-based, client-side switching) Use tab() for each button, tab_panel() for each content. Requires Alpine.js. Usage: from "chirpui/tabs_panels.html" import tabs_container, tab, tab_panel {% call tabs_container(active="overview") %} {{ tab("overview", "Overview", active=true) }} {{ tab("details", "Details") }} {{ tab_panel("overview", active=true) %} Overview content {% end %} {{ tab_panel("details") %} Details content {% end %} {% end %} -#} {% def tab(id, label, active=false) %} {% end %} {% def tab_panel(id, active=false) %}
{% slot %}
{% end %} {% def tabs_container(active=none) %}
{% slot %}
{% end %}