Skip to content

GridResponsiveCard

Since v0.4.0

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
cardRowHeightInputSignal<number | auto | undefined>Card row height in pixels. Use 'auto' for dynamic height based on content.
templateSignal<TemplateRef<any> | undefined>The ng-template containing the card content.

Card row height in pixels. Use 'auto' for dynamic height based on content.

Mirrors to the card-row-height attribute on the underlying <tbw-grid-responsive-card> element which the ResponsivePlugin reads.

Default: 'auto'


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://toolboxjs.com/llms-full.txt