Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Above a table

Put filters, search and actions above a table, and let ticked rows turn the strip into a bulk bar.

A filterable, selectable table
BuildingStatus
Corporate OfficeDraft
Warehouse AnnexeCompliant
Server RoomDraft
Canteen BlockCompliant
Logistics HubCompliant
Show code
<app-table-toolbar for="buildings">
    <app-table-toolbar-filters>
        <app-segmented name="status" value="all" label="Filter by status" size="Sm">…</app-segmented>
    </app-table-toolbar-filters>
    <app-table-toolbar-actions>
        <app-search name="q" placeholder="Search buildings" aria-label="Search buildings"></app-search>
        <app-action-icon icon="download" label="Export all"></app-action-icon>
    </app-table-toolbar-actions>
    <app-table-toolbar-bulk>
        <app-button size="WideSize.Sm" variant="Outline" left-icon="send">Send reminder</app-button>
        <app-button size="WideSize.Sm" variant="Outline" left-icon="download">Export</app-button>
    </app-table-toolbar-bulk>
</app-table-toolbar>
<app-data-table id="buildings" selectable="true">…</app-data-table>

The bulk bar

Show only the actions that make sense for a selection, such as send, export or delete.

Three rows selected
BuildingStatus
Corporate OfficeDraft
Warehouse AnnexeCompliant
Server RoomDraft
Show code
<app-table-toolbar for="buildings">
    <app-table-toolbar-bulk>
        <app-button size="WideSize.Sm" variant="Outline" left-icon="send">Send reminder</app-button>
        <app-button size="WideSize.Sm" variant="Outline" left-icon="download">Export</app-button>
        <app-button size="WideSize.Sm" tone="Danger" left-icon="trash-2">Delete</app-button>
    </app-table-toolbar-bulk>
</app-table-toolbar>
<app-data-table id="buildings" selectable="true">…</app-data-table>

Select all matching

Offer every matching row once a page is ticked, so a bulk action can reach the whole query.

Select all 1,284 matching
BuildingStatus
Corporate OfficeDraft
Warehouse AnnexeCompliant
Server RoomDraft
Canteen BlockCompliant
Logistics HubCompliant
Show code
<app-table-toolbar for="buildings" total-count="1284">
    <app-table-toolbar-bulk>
        <app-button size="WideSize.Sm" variant="Outline" left-icon="send">Send reminder</app-button>
        <app-button size="WideSize.Sm" variant="Outline" left-icon="download">Export</app-button>
    </app-table-toolbar-bulk>
</app-table-toolbar>
<app-data-table id="buildings" selectable="true">…</app-data-table>

Every option

Every value of every prop, one cell each.

for: the table it serves

for="tb-mx-link" (React: the toolbar sits directly above AppDataTable)

filters and actions: which sides are filled

app-table-toolbar-filters only
app-table-toolbar-actions only
filters + actions

bulkActions: the bulk bar's buttons

app-table-toolbar-bulk: send reminder, export and delete (tick rows to see them)
Building
Corporate Office
Warehouse Annexe
Server Room

selectedCount: toolbar or bulk bar

selectedCount=0 (default): no rows ticked
Building
Corporate Office
Warehouse Annexe
Server Room
selectedCount=3: tick rows to show the bulk bar
Building
Corporate Office
Warehouse Annexe
Server Room

onClearSelection: the Clear button

onClearSelection: Clear always shown, tick rows to see it
Building
Corporate Office
Warehouse Annexe
Server Room

totalCount: the rows matching across pages

total-count omitted (default): no offer
Building
Corporate Office
Warehouse Annexe
Server Room
total-count="1284": tick every row to offer Select all 1,284 matching
Building
Corporate Office
Warehouse Annexe
Server Room

pageCount: the rows on the page

pageCount: no attribute, Razor counts the linked table's rows
Building
Corporate Office
Warehouse Annexe
Server Room

onSelectAllMatching: taking the offer

onSelectAllMatching: taking the offer adds a hidden selectAllMatching field
Building
Corporate Office
Warehouse Annexe
Server Room

allMatchingSelected: every matching row ticked

allMatchingSelected: Razor derives it, All 1,284 selected once the offer is taken
Building
Corporate Office
Warehouse Annexe
Server Room

selectAllMatchingLabel: the Select all text

select-all-matching-label omitted (default): Select all {count} matching
Building
Corporate Office
Warehouse Annexe
Server Room
select-all-matching-label="Select all {count} records"
Building
Corporate Office
Warehouse Annexe
Server Room

selectedLabel: the count text

selected-label omitted (default): 3 selected
Building
Corporate Office
Warehouse Annexe
Server Room
selected-label="{count} ticked"
Building
Corporate Office
Warehouse Annexe
Server Room

allSelectedLabel: the count text when every row is ticked

all-selected-label omitted (default): All 1,284 selected once the offer is taken
Building
Corporate Office
Warehouse Annexe
Server Room
all-selected-label="Every {count} records selected"
Building
Corporate Office
Warehouse Annexe
Server Room

clearLabel: the Clear button text

clear-label omitted (default): Clear
Building
Corporate Office
Warehouse Annexe
Server Room
clear-label="Untick all"
Building
Corporate Office
Warehouse Annexe
Server Room

clearSelectionLabel: the Clear text when every row is ticked

clear-selection-label omitted (default): Clear selection once the offer is taken
Building
Corporate Office
Warehouse Annexe
Server Room
clear-selection-label="Clear the whole query"
Building
Corporate Office
Warehouse Annexe
Server Room

className: extra classes on the toolbar

class: a plain class attribute, none added here (React: className)

Guidance

What to do, and what to avoid.

Use it when

  • A table needs filters, a search box or export above it.
  • Rows are selectable and the selection has actions of its own.
  • You want the filter strip and the bulk bar to share one place, so the table never jumps.

Reach for something else when

  • The table has no filters, search or selection. → no toolbar
  • You are paging through rows. → AppTablePagination
  • The action belongs to one row, not a selection. → the rowActions prop on AppDataTable

Show bulk actions only when selected

Do

Bulk actions appear only while rows are selected, with the count and a way out.

Avoid

A row of always-visible, disabled bulk buttons takes space and explains nothing until something is selected.

Filters left, search and actions right

Do

Filters narrow the rows on the left; search and actions sit on the right.

Avoid

Search first and filters last, scattered with no shared strip: the eye has no fixed place to look.

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

status segments a filter button none
search + export export only none
send + export delete only
BuildingStatus
Corporate OfficeDraft
Warehouse AnnexeCompliant
Server RoomDraft
React, generated from the controls
<AppTableToolbar
  filters={filters}
  actions={actions}
  selectedCount={0}
  bulkActions={bulkActions}
  onClearSelection={() => setSelected(new Set())}
/>
Razor, the same props
<app-table-toolbar for="tb-pg">
    <app-table-toolbar-filters>…</app-table-toolbar-filters>
    <app-table-toolbar-actions>…</app-table-toolbar-actions>
    <app-table-toolbar-bulk>…</app-table-toolbar-bulk>
</app-table-toolbar>
<app-data-table id="tb-pg" selectable="true">…</app-data-table>

15 props. The 2 most used come first.

Used on most screens 2 props

PropTypeDefaultDescription
total-countdefault - number - The rows matching across every page. With onSelectAllMatching, the bulk bar offers Select all N matching once the page is selected and more rows match than it shows.
selectedCountdefault - number - Razor derives the count from the linked table's selection; there is no attribute.

Less common 13 props

PropTypeDefaultDescription
fordefault - string - The id of the selectable app-data-table this toolbar serves. The bar swaps to the bulk bar while that table has rows selected and keeps the count current.
app-table-toolbar-filtersdefault - child - The left side: status segments, chips or a filter menu.
app-table-toolbar-actionsdefault - child - The right side: search, export or a columns menu.
app-table-toolbar-bulkdefault - child - The buttons shown in the bulk bar, beside the count.
select-all-matching-labeldefault Select all {count} matching string Select all {count} matching The Select all button's text, for other languages. {count} is the matching row total.
clear-labeldefault Clear string Clear The Clear button's text, for other languages.
selected-labeldefault {count} selected string {count} selected The bulk bar's count text, for other languages. {count} is the selected row count.
all-selected-labeldefault All {count} selected string All {count} selected The bulk bar's count text when every matching row is selected, for other languages. {count} is the matching row total.
clear-selection-labeldefault Clear selection string Clear selection The Clear button's text when every matching row is selected, for other languages.
pageCountdefault - number - Razor counts the linked table's rows.
onSelectAllMatchingdefault - () => void - Razor adds a hidden selectAllMatching field (data-select-all-matching) to the bulk bar when the offer is taken.
allMatchingSelecteddefault - boolean - Razor derives it from the offer being taken.
onClearSelectiondefault - () => void - Razor always renders a Clear button and wires it to the linked table.

Screen reader

3 notes
  • The selected count is an aria-live polite region, so a change in the selection is announced.
  • Only one of the two rows is shown at a time: the other has the hidden attribute, so it leaves the accessibility tree.
  • Select all N matching and Clear are native buttons.

Do and avoid

2 pairs

Show bulk actions only when selected

Do

Bulk actions appear only while rows are selected, with the count and a way out.

Avoid

A row of always-visible, disabled bulk buttons takes space and explains nothing until something is selected.

Filters left, search and actions right

Do

Filters narrow the rows on the left; search and actions sit on the right.

Avoid

Search first and filters last, scattered with no shared strip: the eye has no fixed place to look.