Card

2.4.0
Beta

Cards group related content and actions into a contained, scannable unit. They support media, headers, body text, and footers for flexible content layouts.

import {CardModule} from "@qualcomm-ui/angular/card"

Examples

Showcase

All card parts are optional. Combine them to fit the content you need to display.

Card Title
Subheading
Paragraph Subheading

This is a small card with media, header, body text, and a footer with actions.

<div class="w-72" q-card variant="outline">
  <div q-card-media>
    <div q-card-avatar>
      <div q-avatar-content>
        <svg aria-label="User" qIcon="User"></svg>
      </div>
    </div>
  </div>
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Card Title</div>
      <div q-card-subheading-text>Subheading</div>
    </div>

    <div q-card-subheading-text>Paragraph Subheading</div>
    <p q-card-paragraph-text>
      This is a small card with media, header, body text, and a footer
      with actions.
    </p>
  </div>
  <div q-card-footer>
    <button q-card-button variant="secondary">Cancel</button>
    <button q-card-button variant="primary">Confirm</button>
  </div>
</div>

Variants

The variant input controls border and shadow styles.

Outline

A card with a border and background color.

Outline Elevated

A card with a border and subtle elevation.

Elevated

A card with a subtle elevation and no border.

<div class="w-64" q-card variant="outline">
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Outline</div>
    </div>
    <p q-card-paragraph-text>
      A card with a border and background color.
    </p>
  </div>
</div>

<div class="w-64" q-card variant="outline-elevated">
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Outline Elevated</div>
    </div>
    <p q-card-paragraph-text>
      A card with a border and subtle elevation.
    </p>
  </div>
</div>

<div class="w-64" q-card variant="elevated">
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Elevated</div>
    </div>
    <p q-card-paragraph-text>
      A card with a subtle elevation and no border.
    </p>
  </div>
</div>

Actions

Two types of actions are supported in cards: q-card-button and q-card-link.

Link Action

Cards can use links to navigate users to related content.

Button Actions

Cards can use buttons for primary and secondary actions.

<div class="w-64 self-start" q-card variant="outline">
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Link Action</div>
    </div>
    <p q-card-paragraph-text>
      Cards can use links to navigate users to related content.
    </p>
  </div>
  <div q-card-footer>
    <a endIcon="ChevronRight" q-card-link>Learn More</a>
  </div>
</div>

<div class="w-64" q-card variant="outline">
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Button Actions</div>
    </div>
    <p q-card-paragraph-text>
      Cards can use buttons for primary and secondary actions.
    </p>
  </div>
  <div q-card-footer>
    <button q-card-button variant="secondary">Cancel</button>
    <button q-card-button variant="primary">Confirm</button>
  </div>
</div>

Interactive

Set interactive on q-card to enable hover and pressed visual states on the content area. Place the directive on a <button> element so screen readers know that the element is interactive.

WARNING

Interactive cards must not contain buttons, links, or input fields. Nesting interactive elements produces invalid HTML and breaks assistive technology.

<button class="w-64" interactive q-card variant="elevated">
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Interactive Card</div>
    </div>
    <p q-card-paragraph-text>
      Hover or press this card to see the interactive states.
    </p>
  </div>
</button>

Media

Use q-card-media to display an image or other visual content at the top of the card.

Qualcomm automotive technology
Automotive Platform
Next-gen connectivity
<div class="w-64" q-card variant="outline">
  <div q-card-media>
    <img
      alt="Qualcomm automotive technology"
      class="h-40 w-full"
      src="https://react.qui.qualcomm.com/images/auto-vertical-1.png"
    />
  </div>
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Automotive Platform</div>
      <div q-card-subheading-text>Next-gen connectivity</div>
    </div>
  </div>
  <div q-card-footer>
    <a endIcon="ChevronRight" q-card-link>Learn More</a>
  </div>
</div>

Badge

Use the q-card-badge directive to position a badge within the card.

NEW
Snapdragon X2 Elite
A legendary leap in performance

Unleash your masterpiece with ultra-premium performance, multi-day battery life, and blazing AI processing power.

<div class="w-72" q-card variant="outline">
  <div q-card-badge>
    <span emphasis="brand" q-badge>NEW</span>
  </div>
  <div q-card-content>
    <div q-card-heading>
      <div q-card-heading-text>Snapdragon X2 Elite</div>
      <div q-card-subheading-text>A legendary leap in performance</div>
    </div>
    <p q-card-paragraph-text>
      Unleash your masterpiece with ultra-premium performance, multi-day
      battery life, and blazing AI processing power.
    </p>
  </div>
  <div q-card-footer>
    <a endIcon="ChevronRight" q-card-link>Learn More</a>
  </div>
</div>

Alignment

Set alignment on q-card to control horizontal positioning of heading and footer content. Defaults to start.

Eyebrow
Card Title
Subheading

Toggle between start and center alignment to see how heading and footer content repositions.

<div class="w-80" q-card variant="outline" [alignment]="alignment()">
  <div q-card-content>
    <div q-card-heading>
      <span q-card-eyebrow-text>Eyebrow</span>
      <div q-card-heading-text>Card Title</div>
      <div q-card-subheading-text>Subheading</div>
    </div>
    <p q-card-paragraph-text>
      Toggle between start and center alignment to see how heading and
      footer content repositions.
    </p>
  </div>
  <div q-card-footer>
    <button q-card-button variant="secondary">Cancel</button>
    <button q-card-button variant="primary">Confirm</button>
  </div>
</div>

Sizes

Cards support sm, md, and lg sizes that control internal spacing and typography.

Eyebrow
Card Title
Subheading

Resize this card using the controls below to see how spacing and typography scale across sizes.

<div q-card variant="outline" [size]="size()" [style.width.px]="width()">
  <div q-card-media>
    <div q-card-avatar>
      <div q-avatar-content>
        <svg aria-label="User" qIcon="User"></svg>
      </div>
    </div>
  </div>
  <div q-card-content>
    <div q-card-heading>
      <span q-card-eyebrow-text>Eyebrow</span>
      <div q-card-heading-text>Card Title</div>
    </div>
    <div q-card-subheading-text>Subheading</div>
    <p q-card-paragraph-text>
      Resize this card using the controls below to see how spacing and
      typography scale across sizes.
    </p>
  </div>
  <div q-card-footer>
    <button q-card-button variant="secondary">Cancel</button>
    <button q-card-button variant="primary">Confirm</button>
  </div>
</div>

Explorer

API

q-card

PropTypeDefault
The horizontal alignment of card content and footer.
| 'start'
| 'center'
'start'
The document's text/writing direction.
'ltr' | 'rtl'
'ltr'
When true, the card renders as an interactive element with hover and active states.
boolean
The size of the card and its elements. Governs padding, spacing, and typography.
| 'sm'
| 'md'
| 'lg'
'sm'
The visual style of the card.
| 'outline'
| 'outline-elevated'
| 'elevated'
'outline'
Type
| 'start'
| 'center'
Description
The horizontal alignment of card content and footer.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
boolean
Description
When true, the card renders as an interactive element with hover and active states.
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the card and its elements. Governs padding, spacing, and typography.
Type
| 'outline'
| 'outline-elevated'
| 'elevated'
Description
The visual style of the card.

q-card-media

PropTypeDefault
The padding around the media content.
'sm' | 'lg'
'sm'
Type
'sm' | 'lg'
Description
The padding around the media content.

q-card-avatar

PropType
The document's text/writing direction.
'ltr' | 'rtl'
HTML id attribute. If omitted, a unique identifier will be generated for accessibility.)
string
Function called when the avatar state is changed.
{
state: string
}
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
string
Description
HTML id attribute. If omitted, a unique identifier will be generated for accessibility.)
Type
{
state: string
}
Description
Function called when the avatar state is changed.

q-card-badge

q-card-content

q-card-heading

q-card-eyebrow-text

q-card-heading-text

q-card-menu-trigger

q-card-subheading-text

q-card-paragraph-text

q-card-button

PropTypeDefault
lucide-angular icon, positioned after the label.
| LucideIconData
| string
lucide-angular icon, positioned before the label.
| LucideIconData
| string
The visual variant of the card button. Maps to underlying QDS button emphasis and variant props.
| 'primary'
| 'secondary'
'primary'
Type
| LucideIconData
| string
Description
lucide-angular icon, positioned after the label.
Type
| LucideIconData
| string
Description
lucide-angular icon, positioned before the label.
Type
| 'primary'
| 'secondary'
Description
The visual variant of the card button. Maps to underlying QDS button emphasis and variant props.
PropTypeDefault
lucide-angular icon, positioned after the label.
| LucideIconData
| string
lucide-angular icon, positioned before the label.
| LucideIconData
| string
The visual variant of the card link. Maps to underlying QDS link emphasis.
| 'primary'
| 'secondary'
'primary'
Type
| LucideIconData
| string
Description
lucide-angular icon, positioned after the label.
Type
| LucideIconData
| string
Description
lucide-angular icon, positioned before the label.
Type
| 'primary'
| 'secondary'
Description
The visual variant of the card link. Maps to underlying QDS link emphasis.
Last updated on by Ryan Bower