Toggle between list and table with a single config
Minimal example
<!-- Same surface, same state — swap the renderer. -->
<nat-table-surface [enableSorting]="true" [enableReordering]="true" [(state)]="state">
@if (view() === 'table') {
<nat-table [columns]="columns" [data]="rows" accessibleName="Orders" />
} @else {
<nat-list [columns]="columns" [data]="rows" accessibleName="Orders" />
}
</nat-table-surface>// component.ts — the list has no header UI; sort and reorder it by writing the state.
protected readonly view = signal<'table' | 'list'>('table');
protected readonly state = signal<Partial<NatTableUserState>>({});
protected sortByTotal(): void {
this.state.update((current) => ({ ...current, sorting: [{ id: 'total', desc: true }] }));
}
protected moveField(columnOrder: string[]): void {
this.state.update((current) => ({ ...current, columnOrder }));
}Showing 12 rows across 9 visible columns.
Use arrow keys to move between cells. A cell whose only content is a single button or link focuses it directly. In cells with several controls, press Enter to interact with them, Tab to move forward between them, Shift+Tab to move backward, and Escape to return to the cell. Press Control+Shift+Left Arrow or Control+Shift+Right Arrow to reorder columns within their current pinned region. On macOS, press Command+Shift+Left Arrow or Command+Shift+Right Arrow.
| Summit Crest | Summit Crest Logistics | Online | West | 5 | Jun 1 | $1,500 | ||
| Beacon Tech | Beacon Tech Labs | Retail | Midwest | 12 | Jun 2 | $5,400 | ||
| Horizon Ventures | Horizon Ventures Group | Wholesale | Northeast | 19 | Jun 3 | $11,400 | ||
| Vanguard Systems | Vanguard Systems Corp | Online | South | 26 | Jun 4 | $19,500 | ||
| Zenith Logistics | Zenith Logistics Services | Retail | West | 33 | Jun 5 | $29,700 | ||
| Quantum Energy | Quantum Energy Group | Wholesale | Midwest | 40 | Jun 6 | $42,000 | ||
| Pacific Trade | Pacific Trade & Supply | Online | Northeast | 47 | Jun 7 | $56,400 | ||
| Caliber Manufacturing | Caliber Manufacturing Co | Retail | South | 9 | Jun 8 | $12,150 | ||
| Summit Crest | Summit Crest Logistics | Wholesale | West | 16 | Jun 9 | $24,000 | ||
| Beacon Tech | Beacon Tech Labs | Online | Midwest | 23 | Jun 10 | $37,950 | ||
| Horizon Ventures | Horizon Ventures Group | Retail | Northeast | 30 | Jun 11 | $9,000 | ||
| Vanguard Systems | Vanguard Systems Corp | Wholesale | South | 37 | Jun 12 | $16,650 |