{#- chirp-ui: Tabs component htmx-powered tab switching with active state tracking. Usage: from "chirpui/tabs.html" import tabs, tab call tabs(active="overview") tab("overview", "Overview", url="/tabs/overview", hx_target="#content") tab("details", "Details", url="/tabs/details", hx_target="#content") end
... tab content loaded via htmx ...
-#} {% def tabs(active=none, cls="") %} {% end %} {% def tab(id, label, url=none, hx_target=none, hx_swap="innerHTML", active=false, cls="") %} {{ label }} {% end %}