Skip to content

GridResponsiveCard

Directive for providing custom Angular templates for responsive card layout.

Use this directive to define how each row should render when the grid is in responsive/mobile mode. The template receives the row data and index.

<tbw-grid [rows]="employees">
<tbw-grid-responsive-card>
<ng-template let-employee let-idx="index">
<div class="employee-card">
<img [src]="employee.avatar" alt="">
<div class="info">
<strong>{{ employee.name }}</strong>
<span>{{ employee.department }}</span>
</div>
</div>
</ng-template>
</tbw-grid-responsive-card>
</tbw-grid>
  • The ResponsivePlugin must be added to your grid config
  • The Grid directive will automatically configure the plugin’s cardRenderer
  • Template context provides $implicit (row), row, and index
PropertyTypeDescription
templateSignal<TemplateRef<any> | undefined>The ng-template containing the card content.

Type guard for template context inference.

ngTemplateContextGuard(_directive: GridResponsiveCard<T>, context: unknown): context
NameTypeDescription
_directiveGridResponsiveCard<T>
contextunknown

AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt