{#- chirp-ui: Tab panels (button-based, client-side switching) Use tab_button() for each button, tab_panel() for each content. Requires Alpine.js. Renamed from tab() to tab_button() to avoid collision with the htmx-based tab() in tabs.html. Usage: from "chirpui/tabs_panels.html" import tabs_container, tab_button, tab_panel {% call tabs_container(active="overview") %} {{ tab_button("overview", "Overview", active=true) }} {{ tab_button("details", "Details") }} {{ tab_panel("overview", active=true) %} Overview content {% end %} {{ tab_panel("details") %} Details content {% end %} {% end %} -#} {% def tab_button(id, label, active=false) %} {% end %} {#- Deprecated alias — use tab_button() instead. -#} {% def tab(id, label, active=false) %}{{ tab_button(id, label, active=active) }}{% end %} {% def tab_panel(id, active=false) %}
{% slot %}
{% end %} {% def tabs_container(active=none) %}
{% slot %}
{% end %}