Angular toolbar and view controls
The table’s search and pagination work without a preset. Additional controls are opt-in features from the selected kit: density, fullscreen, export, saved views, commands and printing. Each contributes its own controls to the toolbar or status area, using native HTML in the unstyled kit and NG-ZORRO in that kit.
Compose only the controls you need
Section titled “Compose only the controls you need”import { Component } from "@angular/core";import type { ColumnDef } from "@adapttable/angular";import { AdaptDataTable } from "@adapttable/angular-unstyled";import { densityChooser } from "@adapttable/angular-unstyled/density";import { fullscreen } from "@adapttable/angular-unstyled/fullscreen";import { statusBar } from "@adapttable/angular-unstyled/status-bar";import { commandPalette } from "@adapttable/angular-unstyled/command-palette";import { print } from "@adapttable/angular-unstyled/print";
interface Order { id: string; customer: string;}
@Component({ selector: "app-orders-toolbar", imports: [AdaptDataTable], template: ` <adapt-data-table tableLabel="Orders" urlKey="orders" [data]="rows" [columns]="columns" [rowKey]="rowKey" [features]="features" /> `,})export class OrdersToolbar { readonly rows: readonly Order[] = [{ id: "o1", customer: "Ada" }]; readonly columns: readonly ColumnDef<Order>[] = [{ key: "customer" }]; readonly rowKey = (row: Order) => row.id; readonly features = [ densityChooser(), fullscreen(), statusBar(), commandPalette({ button: true }), print(() => window.print(), true), ];}The window.print() call runs on a user action, not during server rendering.
The callback owns the print behavior; pass true as the second argument to
show its toolbar button. Without it, the print action can still be offered in
the command palette.
For NG-ZORRO, change all kit imports together to @adapttable/ng-zorro.
See getting started for installation
and first-release status.
Toolbar templates
Section titled “Toolbar templates”Your own controls go in the toolbar through three templates projected into
the table, the Angular form of React’s toolbar and toolbarSlots. None
needs a feature, and each kit draws them in the same places:
| Template | Where it sits |
|---|---|
#toolbarStart |
Ahead of the search field. |
#toolbar |
After search and the sort select, before the Filters button. |
#toolbarEnd |
After every built-in control, add row included. |
<adapt-data-table [data]="rows" [columns]="columns" [rowKey]="rowKey" [features]="features"> <ng-template #toolbarStart> <button type="button" (click)="back()">Back</button> </ng-template> <ng-template #toolbar> <button type="button" (click)="showBoard()">Board view</button> </ng-template> <ng-template #toolbarEnd> <a href="/help/orders">Help</a> </ng-template></adapt-data-table>Use your kit’s own components inside them, as for any other host content.
The toolbar keeps them on the card layout too, and its inline order follows
[dir], so the start sits on the right in RTL.
Preset and individual entries
Section titled “Preset and individual entries”standardFeatures() from your kit’s /preset returns these ten features:
columnMenu, resizableColumns, fitColumns, densityChooser, exportCsv,
findInTable, fullscreen, multiSort, statusBar and headerFilters.
Its optional grouping, bulkActions, filters and savedViews
arguments add configured features. It does not automatically include cell
editing, virtualization, a command palette or every separately available
feature.
The result is an ordinary array. Import individual entries when a small import
graph matters. Angular’s kit /features entry aggregates kit factories; it is
not React’s headless feature aggregate.
State, focus and browser support
Section titled “State, focus and browser support”- Density switches between comfortable and compact. The choice participates
in URL state; use a distinct
urlKeyfor independent tables - Fullscreen is available where the browser supports it and requires a real user gesture. The state follows the document, including the browser’s Escape action; a refused request does not mean the table entered fullscreen
- Saved views record supported table state. Pair their persistence options with your host’s storage and permission model
- The views popover closes on Escape and returns focus to its trigger. Keep visible controls reachable on narrow screens instead of relying on a shortcut
[labels]supplies localized captions,[dir]supplies direction and[locale]picks the field that columns withi18npaths read; see localization and RTL[stickyHeader]="true"keeps the desktop header in view. Inside amaxHeightbox or a table that scrolls sideways it sticks at the top of the box; on a page-scrolling table it sticks at[stickyTop], the height of any app bar it must clear. Pinned rows sit below a sticky header
sidePanel() from /side-panel accepts named panels and a controlled open
key or null, plus onOpenChange. Panel content can be a template or plain
text. Keep the current key in an Angular signal and provide a computed feature
array when those options change. The panel’s side is logical start/end, so it
can follow RTL. See Customization for Angular templates.
For edit history, compose editHistory() and undoRedoButtons() from
/editing; the buttons rely on host write callbacks and do not persist rows
themselves. Export progress, errors and retry actions belong to the export
controller, not an application timer pretending a download completed.
See Saved views, Command palette, Exporting, Cell editing and URL state. The toolbar tests exercise density, fullscreen, export and Escape focus restoration.
When [density] is supplied, it is a live controlled value. The chooser emits
(densityChange) and waits for the host to update the input; without a supplied
value it keeps its own URL/local state. A host can observe (densityChange) in
either mode.
Your page can also draw its own filter, sort and search controls bound to the table (host-drawn controls), and its own list or grid in place of the body with a mode switcher (custom layouts).