tabs(label:) do |t|
t.with_tab(label, href: nil, count: nil, selected: false, panel: nil)
t.with_action { … }
end
tab_panel(id:, selected: false) do
# shown while the tab with panel: id is selected
end
Tabs without href: switch on the page: give each one panel: with the id of a tab_panel and only the selected panel shows. Arrow keys move between tabs. They dispatch componeer--tabs:change.
Tabs with href: are links, so each subset has its own URL (the usual choice for filtered lists, as in page_header's tabs slot).
Lançar o canal até março
Fechar 3 clientes novos no trimestre
Configurar a base do projeto
Testar anúncios pagos — abandonada em 02/10/2026.
<%= tabs(label: "Situação da quest") do |t| %>
<% t.with_tab "Ativas", count: 2, selected: true, panel: "quests-active" %>
<% t.with_tab "Concluídas", count: 1, panel: "quests-completed" %>
<% t.with_tab "Abandonadas", count: 1, panel: "quests-abandoned" %>
<% end %>
<%= tab_panel(id: "quests-active", selected: true, style: "padding: 16px 0") do %>
<%= stack(gap: "8px") do %>
<span>Lançar o canal até março</span>
<span>Fechar 3 clientes novos no trimestre</span>
<% end %>
<% end %>
<%= tab_panel(id: "quests-completed", style: "padding: 16px 0") do %>
<span>Configurar a base do projeto</span>
<% end %>
<%= tab_panel(id: "quests-abandoned", style: "padding: 16px 0") do %>
<%= empty_state "Testar anúncios pagos — abandonada em 02/10/2026." %>
<% end %>