Toolbar slots
View sourceThe toolbar render-prop receives a typed context with pre-built sub-slots — search input, group-by dropdown, density picker, clear-filters button, saved-view picker — that you compose alongside your domain actions.
Try this
Every chrome element in the toolbar except the title and the buttons on the right comes from BcToolbarContext sub-slots.
- Type in the search box — built-in search input from
ctx.searchInput. - Click the group-by dropdown — pre-wired against
ctx.groupBy. - Toggle density — same chrome the right-click menu would surface, surfaced inline via
ctx.densityPicker. - Apply a filter, then click Clear filters — built-in button.
- The Export and New order buttons are consumer-owned — your domain logic.
Pre-built sub-slots
- searchInput. Search field bound to
ctx.searchText/setSearchText. Honours the search-hotkey badge and the column highlight pipeline. - quickFilterInput. Optional advanced quick-filter input — opt in via
quickFilteronBcGridProps. - groupByDropdown. Multi-select dropdown of every
groupable: truecolumn. Wires tosetGroupBy. - densityPicker. compact / normal / comfortable.
- clearFiltersButton. Disabled when no filters active.
- savedViewPicker. Placeholder slot — swap in your saved-view chrome and the toolbar layout stays stable.
Why slots beat hand-rolled toolbars
Each pre-built slot speaks the right grid API — search composes with column highlight, group-by composes with aggregations, density composes with row virtualization. Hand-rolling them means re-discovering all those compositions yourself. The slots are also screen-reader-correct, keyboard-navigable, and theme-aware out of the box.
Or skip the toolbar
The toolbar is opt-in. If you don't need chrome above the grid, omit the prop and bc-grid renders the body directly. Search / group / density still work — they just live in the right-click context menu only.