Component

Table

A data table built on native table markup with directives. Style it with size, stripes, gridlines, and hover; make headers sortable; select rows single or multiple; toggle columns; and filter and sort your data with the bundled pipes.

Structure & style

Autumn photos
IndexTitleCityTaken
IMG·019Oak leavesFreiburg2026·11·03
IMG·020Foggy morningMunich2026·11·08
IMG·021ChestnutsBerlin2026·11·15
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { HbTableImports } from '@herbst/ui';

@Component({
  selector: 'hb-demo-table-basic',
  imports: [HbTableImports],
  template: `
    <hb-table hbStriped hbGridlines hbSize="sm" class="w-full max-w-lg">
      <caption hb-table-caption>
        Autumn photos
      </caption>
      <thead hb-table-header>
        <tr hb-table-row>
          <th hb-table-head>Index</th>
          <th hb-table-head>Title</th>
          <th hb-table-head>City</th>
          <th hb-table-head>Taken</th>
        </tr>
      </thead>
      <tbody hb-table-body>
        @for (r of rows; track r.id) {
          <tr hb-table-row>
            <td hb-table-cell>IMG·{{ r.id }}</td>
            <td hb-table-cell>{{ r.species }}</td>
            <td hb-table-cell>{{ r.family }}</td>
            <td hb-table-cell>{{ r.shelf }}</td>
          </tr>
        }
      </tbody>
    </hb-table>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HbDemoTableBasicComponent {
  protected readonly rows = [
    { id: '019', species: 'Oak leaves', family: 'Freiburg', shelf: '2026·11·03' },
    { id: '020', species: 'Foggy morning', family: 'Munich', shelf: '2026·11·08' },
    { id: '021', species: 'Chestnuts', family: 'Berlin', shelf: '2026·11·15' },
  ];
}

Sortable & filtered

TitleCityYear
ChestnutsHamburg2026
Foggy morningMunich2025
Forest pathBerlin2023
Oak leavesFreiburg2024

Row selection

TitleCity
Oak leavesFreiburg
Foggy morningMunich
Forest pathBerlin
ChestnutsHamburg

0 selected

API reference

hb-table — appearance

PropertyDescriptionTypeDefault
[hbSize] Row height and text scale. 'xs' | 'sm' | 'md' | 'lg' | 'xl' 'md'
[hbStriped] / [hbGridlines] / [hbHoverable] / [hbBordered] Zebra rows, cell borders, row hover highlight, and an outer border. boolean false / false / true / true
[hbScrollable] / [hbScrollHeight] Constrain the height with a sticky header and scroll the body. boolean / string false / —
[hbLoading] Overlay a spinner while data loads. boolean false

hb-table — selection

PropertyDescriptionTypeDefault
[hbSelectionMode] Whether rows are selectable, and how many at once. 'none' | 'single' | 'multiple' 'none'
[(hbSelection)] The selected row(s) — a value for single, an array for multiple. Two-way bound. unknown null
[hbDataKey] / [hbCompareWith] A property that uniquely identifies a row, or a custom equality function for matching selection. string / (a, b) => boolean '' / —
[hbMetaKeySelection] / (hbRowActivate) Require Ctrl/Cmd to add to a multiple selection, and emit a row when Enter is pressed. boolean / unknown false

hb-table — sorting & columns

PropertyDescriptionTypeDefault
[hbSortMode] / [(hbSort)] Single or multi-column sorting, and the two-way bound sort meta ({ field, order }). 'single' | 'multiple' / HbSortMeta | HbSortMeta[] 'single' / null
[hbRemovableSort] / [hbCustomSort] Allow clearing the sort by cycling past descending, and skip the built-in reordering (you sort the data yourself). boolean false
[(hbHiddenColumns)] The keys of columns hidden by hb-table-column-toggle. string[] []
[hbKeyboardNavigation] / [hbShowShortcuts] Enable arrow/Home/End/Space/Enter row navigation, and show a shortcut legend below the table. boolean false

Structure & pipes

PropertyDescriptionTypeDefault
thead / tbody / tfoot / tr / th / td / caption Native elements with directives: [hb-table-header], [hb-table-body], [hb-table-footer], [hb-table-row] (with [hbRowValue]), [hb-table-head] (with [hbSortField]), [hb-table-cell], [hb-table-caption]. directives
hb-table-select-all / -checkbox / -radio Drop-in selection controls: a header select-all, and a per-row checkbox or radio. components
hb-table-expand-toggle / -column-toggle A per-row expander (with (hbExpandedChange)), and a menu to show/hide columns. components
hbTableSort / hbTableFilter pipes Sort rows by the sort meta, and filter rows by a query over given fields — applied in the @for expression. pipe