segmented(label:) do |views|
views.with_item(label, href: nil, pressed: false, value: nil)
end
Without href: the items are buttons that switch on the page and dispatch componeer--segmented:change with the chosen value (first row). With href: each item is a link and the current one gets aria-current (second row): use that when each view has its own URL. For filters use a multi-select; for record subsets with counts use tabs.
<%= stack(gap: "12px") do %>
<%= segmented(label: "Visão") do |views| %>
<% views.with_item "Dia", value: "day", pressed: true %>
<% views.with_item "Semana", value: "week" %>
<% views.with_item "Mês", value: "month" %>
<% end %>
<%= segmented(label: "Visão por URL") do |views| %>
<% views.with_item "Dia", href: "?view=day", pressed: true %>
<% views.with_item "Semana", href: "?view=week" %>
<% views.with_item "Mês", href: "?view=month" %>
<% end %>
<% end %>