Bulk actions bar
An extendable action region for selected rows in a data table.
Try it
Archive selected
An extension template included in a table form.
Use it
Working invocation
This code creates the configuration shown above. Copy the template and the required Python context together.
{% extends "brickwork/components/_bulk_actions_bar.html" %}
{% load brickwork_components %}
{% block bulk_actions_buttons %}{% bw_button label="Archive" type="submit" name="bulk_action" value="archive" variant="secondary" size="sm" %}{% endblock %}
context = {'select_all_label': 'Select all'}
Guide
Add it to your project
- Create a small project template extending the partial.
- Fill `bulk_actions_buttons` with submit buttons.
- Include that project template inside the same form as the selectable table.
- Optionally initialise `bwTableSelection()` on the form for live count enhancement.
Options
Public API
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
| select_all_href | str | Not set | No | Consumer-defined no-JS URL for selecting every matching result. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component. |
| select_all_label | str | Select all | No | Text for that optional link. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component. |
Named blocks
Fill these only when you extend the component template. They are not values passed to an include or tag.
| Block | What it replaces |
|---|---|
| bulk_actions_buttons | Consumer action controls. Constraint: Fill by extending; an include cannot fill this block. |
Behaviour
Accessibility and responsive behaviour
- Accessibility
- The live count is polite when enhanced, and the no-JS path uses real checkboxes and submit controls.
- Responsive
- No breakpoint switch.
- Without JavaScript
- Actions remain usable without the live selection count enhancement.
Need help?
Troubleshooting
Contract check: use-case specific. Extend-consumed, like _card.html: {% include %} cannot
Extend the partial to fill `bulk_actions_buttons`; an include cannot fill its named block.