The bar of bulk actions for a table with selection: how many are selected, optional fields,
buttons for the actions and a close that clears the selection. It shows only while count is
above zero.
<.bulk_bar
id="orders-bulk"
count={@count}
label="selecionado"
label_plural="selecionados"
total={@total}
on_select_all="select_all"
on_clear="clear_selection"
>
<:action icon="file" phx-click="issue">Emitir NF-e</:action>
<:action icon="download" phx-click="export">Exportar</:action>
<:action variant="danger" icon="trash" phx-click="delete" confirm="Excluir 3 pedidos?"
confirm_text="Os rascunhos somem para todos." confirm_label="Excluir" cancel_label="Cancelar">
Excluir
</:action>
</.bulk_bar>Texts come from outside (label, label_plural, select_all_label with %{total},
clear_label); nothing is pluralized here.
Looks
inverse(default),softandsolid: thelu-selbarpill (dark, accent-soft and teal).inline: the strip at the top of a table (lu-paneltinted with the accent): a checkbox that clears the selection, the count, "select all" and the buttons.float(lu-bulkfloat, the canvas template's bar): a dark pill absolutely positioned at the bottom center of the closest positioned ancestor (the app shell), with the count, one:actionper button (variant="danger"is red and set apart by a rule) and the close. It ignoresfloating,progressand theconfirmof an action (the action runs at once).
floating (default) pins a pill to the bottom center of the viewport; floating={false} lays
it out where it is (a bar inside a card or a toolbar). progress/progress_max turn the bar
into a progress bar while a bulk action runs. Esc runs on_clear (phx-window-keydown).
An :action with confirm opens a small card first (above the bar when floating, below
otherwise); only its confirm button runs the action's phx-click. A disabled action keeps the
focus (aria-disabled) and renders no phx-* attributes.
selection_bar/1 is the same bar with floating off by default.
Summary
Functions
The selection pill: bulk_bar/1 laid out in place (not floating) by default.
Functions
Attributes
id(:string) (required)count(:integer) (required) - How many are selected; the bar shows only above zero.label(:string) - The text after the count, for one selected. Defaults to"selected".label_plural(:string) - Defaults tonil.total(:integer) - How many there are in all (every page). Defaults tonil.select_all_label(:string) - Defaults to"Select all %{total}".on_clear(:any) - Defaults tonil.on_select_all(:any) - Defaults tonil.target(:any) - Defaults tonil.clear_label(:string) - Defaults to"Clear selection".check_label(:string) -aria-labelof theinlinecheckbox. Defaults to"Selection".show_esc(:boolean) - Defaults tofalse.variant(:string) - Defaults to"inverse". Must be one of"inverse","soft","solid","inline", or"float".floating(:boolean) - Defaults totrue.progress(:integer) - Defaults tonil.progress_max(:integer) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
action- A button. Accepts attributes:variant(:string) - Must be one of"default","primary", or"danger".disabled(:boolean)icon(:string)confirm(:string)confirm_text(:string)confirm_label(:string)cancel_label(:string)id(:string)title(:string)aria-label(:string)phx-click(:any)phx-target(:any)phx-disable-with(:string)phx-value-id(:any)
field- A control (a select, an input) in the bar.
The selection pill: bulk_bar/1 laid out in place (not floating) by default.
Attributes
id(:string) - Defaults to"selection-bar".count(:integer) (required)label(:string) - Defaults to"selected".label_plural(:string) - Defaults tonil.variant(:string) - Defaults to"inverse". Must be one of"inverse","soft","solid", or"inline".floating(:boolean) - Defaults tofalse.on_clear(:any) - Defaults tonil.clear_label(:string) - Defaults to"Clear selection".target(:any) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
action