```json //[doc-seo] { "Description": "Learn how to use the ABP Card Component with Bootstrap, featuring customizable CardHeader, CardBody, and CardFooter components." } ``` # Card Component The ABP Card Component is a wrapper component for the Bootstrap card class. It supports all the features that Bootstrap card component provides. ABP Card Component has three main components, `CardHeader`, `CardBody` and `CardFooter`. These components have their own class and style inputs |Component |Selector |Input Properties | |--------- |-----------------|------------------------------------| |CardHeader|`abp-card-header`| `cardHeaderClass`,`cardHeaderStyle`| |CardBody |`abp-card-body` | `cardBodyClass`,`cardBodyStyle` | |CardFooter|`abp-card-footer`| `cardFooterClass`,`cardFooterStyle`| In addition to these components, the Card component provides directives like `CardHeader`,`CardTitle`,`CardSubtitle`,`CardImgTop`. |Directive |Selector | |-------------|-------------------------------------------------------------| |CardHeader |`abp-card-header`,`[abp-card-header]`,`[abpCardHeader]` | |CardTitle |`abp-card-title`,`[abp-card-title]`,`[abpCardTitle]` | |CardSubtitle |`abp-card-subtitle`,`[abp-card-subtitle]`,`[abpCardSubtitle]`| |CardImgTop |`abp-card-img-top`,`[abp-card-img-top]`,`[abpCardImgTop]` | # Usage ABP Card Component is a part of the `theme-shared` package. Once you import the necessary components, you can use them. See the examples below: ## CardBody ```ts // card-demo.component.ts import { Component } from '@angular/core'; import { CardComponent, CardBodyComponent } from '@abp/ng.theme.shared'; @Component({ selector: 'app-card-demo', imports: [CardComponent, CardBodyComponent], template: ` This is some text within a card body `, }) export class CardDemoComponent {} ``` See the card body result below: ![abp-card-body](./images/abp-card-body.png) ## Titles, Text and Links ```ts //card-demo.component.ts import { Component } from '@angular/core'; import { CardComponent, CardBodyComponent, CardTitleDirective, CardSubtitleDirective } from '@abp/ng.theme.shared'; @Component({ selector: 'app-card-demo', imports: [ CardComponent, CardBodyComponent, CardTitleDirective, CardSubtitleDirective ], template: `
Card Title
Card subtitle

Some quick example text to build on the card title and make up the bulk of the card's content.

Card link Another link
`, }) export class CardDemoComponent {} ``` See the card title, text and link result below: ![abp-card-title-text-link](./images/abp-card-title-text-link.png) ## Images ```ts //card-demo.component.ts import { Component } from '@angular/core'; import { CardComponent, CardBodyComponent, CardImgTopDirective } from '@abp/ng.theme.shared'; @Component({ selector: 'app-card-demo', imports: [CardComponent, CardBodyComponent, CardImgTopDirective], template: ` ...

Some quick example text to build on the card title and make up the bulk of the card's content.

`, }) export class CardDemoComponent {} ``` See the card image result below: ![abp-card-image-top](./images/abp-card-image.png) ## List Groups ```ts //card-demo.component.ts import { Component } from '@angular/core'; import { CardComponent } from '@abp/ng.theme.shared'; @Component({ selector: 'app-card-demo', imports: [CardComponent], template: ` `, }) export class CardDemoComponent {} ``` See the group list result below: ![abp-card-list-group](./images/abp-card-list-group.png) ## Kitchen Sink ```ts //card-demo.component.ts import { Component } from '@angular/core'; import { CardComponent, CardBodyComponent, CardImgTopDirective, CardTitleDirective } from '@abp/ng.theme.shared'; @Component({ selector: 'app-card-demo', imports: [ CardComponent, CardBodyComponent, CardImgTopDirective, CardTitleDirective ], template: ` ...
Card title

Some quick example text to build on the card title and make up the bulk of the card's content.

Card link Another link
`, }) export class CardDemoComponent {} ``` See kitchen sink result below: ![abp-card-kitchen-sink](./images/abp-card-kitchen-sink.png) ## Header and Footer ```ts //card-demo.component.ts import { Component } from '@angular/core'; import { CardComponent, CardHeaderComponent, CardBodyComponent, CardTitleDirective, CardFooterComponent } from '@abp/ng.theme.shared'; @Component({ selector: 'app-card-demo', imports: [ CardComponent, CardHeaderComponent, CardBodyComponent, CardTitleDirective, CardFooterComponent ], template: ` Featured
Special title treatment

With supporting text below as a natural lead-in to additional content.

Go somewhere
2 days ago
`, }) export class CardDemoComponent {} ``` See the header and footer result below: ![abp-card-header-footer](./images/abp-card-header-footer.png)