> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Card

A bordered surface that groups related content, with optional header, title, description, content and footer parts.


## Installation

```bash
npx @blotch/dolan add card
```

```typescript
import {
  UiCard,
  UiCardContent,
  UiCardDescription,
  UiCardFooter,
  UiCardHeader,
  UiCardTitle,
} from '../components/ui/card';
```

## Usage

```typescript title="src/app/app.ts"
import { Component } from '@angular/core';
import { LYNX_ELEMENTS } from '@blotch/angular-lynx';
import {
  UiCard,
  UiCardContent,
  UiCardDescription,
  UiCardFooter,
  UiCardHeader,
  UiCardTitle,
} from '../components/ui/card';

@Component({
  selector: 'app-root',
  imports: [
    LYNX_ELEMENTS,
    UiCard,
    UiCardHeader,
    UiCardTitle,
    UiCardDescription,
    UiCardContent,
    UiCardFooter,
  ],
  template: `
    <ui-card>
      <ui-card-header>
        <ui-card-title>Notifications</ui-card-title>
        <ui-card-description>You have 3 unread messages.</ui-card-description>
      </ui-card-header>
      <ui-card-content>
        <text class="text-sm text-foreground">New deployment started</text>
      </ui-card-content>
      <ui-card-footer>
        <text class="text-sm text-muted-foreground">View all</text>
      </ui-card-footer>
    </ui-card>
  `,
})
export class App {}
```

- Every part is optional. Header, content and footer share the same side padding, so they line up.
- Title and description wrap their content in `<text>`. Content and footer don't, so use your own `<text>` elements there.

### Content only

```angular-html
<ui-card>
  <ui-card-content class="pt-6">
    <text class="text-sm text-foreground">A simple card.</text>
  </ui-card-content>
</ui-card>
```

Content has no top padding, because it usually follows a header. Add `pt-6` when it stands alone.

### Pressable

```angular-html
<ui-card pressable (bindtap)="openOrder()">
  <ui-card-content class="pt-6">
    <text class="text-sm text-foreground">Order #1024</text>
  </ui-card-content>
</ui-card>
```

`pressable` makes the card shrink slightly while a finger is down. It adds no event, so handle the tap yourself with `(bindtap)`.

## API

### UiCard

| Input       | Type      | Default | Description                              |
| ----------- | --------- | ------- | ---------------------------------------- |
| `pressable` | `boolean` | `false` | Shrinks the card slightly while pressed. |
| `class`     | `string`  | `''`    | Extra Tailwind classes for the card.     |

No outputs.

All sub-components (`UiCardHeader`, `UiCardTitle`, `UiCardDescription`, `UiCardContent`, `UiCardFooter`) accept `class`.

## Related

- [Separator](/dolan/separator.md): divide content inside a card
- [Typography](/dolan/typography.md): text styles for card content
- [Handling taps and events](/guide/elements/event-handling.md)
