A generic template component is a reusable Blazor component parameterized by a data type and a rendering template. It receives a sequence of typed objects, generates content for each object, and can add shared behavior such as sorting or highlighting. section 34.3.2
Define the component around three pieces:
- @typeparam RowType declares the row data type. section 34.3.2
- A RowData parameter of type IEnumerable<RowType> supplies the values. section 34.3.2
Reusable people table
Use <TableTemplate RowType="Person" RowData="People"> with a Header fragment and a RowTemplate Context="p". The same component can then render departments by changing the type, data sequence, and row markup.
