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

import {Card} from "@qualcomm-ui/react/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.

<Card.Root className="w-72" variant="outline">
  <Card.Media>
    <Card.Avatar>
      <Avatar.Content icon={User} />
    </Card.Avatar>
  </Card.Media>
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Card Title</Card.HeadingText>
      <Card.SubheadingText>Subheading</Card.SubheadingText>
    </Card.Heading>

    <Card.SubheadingText>Paragraph Subheading</Card.SubheadingText>
    <Card.ParagraphText>
      This is a small card with media, header, body text, and a footer
      with actions.
    </Card.ParagraphText>
  </Card.Content>
  <Card.Footer>
    <Card.Button variant="secondary">Cancel</Card.Button>
    <Card.Button variant="primary">Confirm</Card.Button>
  </Card.Footer>
</Card.Root>

Variants

The variant prop 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.

<Card.Root className="w-64" variant="outline">
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Outline</Card.HeadingText>
    </Card.Heading>
    <Card.ParagraphText>
      A card with a border and background color.
    </Card.ParagraphText>
  </Card.Content>
</Card.Root>

<Card.Root className="w-64" variant="outline-elevated">
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Outline Elevated</Card.HeadingText>
    </Card.Heading>
    <Card.ParagraphText>
      A card with a border and subtle elevation.
    </Card.ParagraphText>
  </Card.Content>
</Card.Root>

<Card.Root className="w-64" variant="elevated">
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Elevated</Card.HeadingText>
    </Card.Heading>
    <Card.ParagraphText>
      A card with a subtle elevation and no border.
    </Card.ParagraphText>
  </Card.Content>
</Card.Root>

Actions

Two types of actions are supported in cards: Card.Button and 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.

<Card.Root className="w-64 self-start" variant="outline">
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Link Action</Card.HeadingText>
    </Card.Heading>
    <Card.ParagraphText>
      Cards can use links to navigate users to related content.
    </Card.ParagraphText>
  </Card.Content>
  <Card.Footer>
    <Card.Link endIcon={ChevronRight}>Learn More</Card.Link>
  </Card.Footer>
</Card.Root>

<Card.Root className="w-64" variant="outline">
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Button Actions</Card.HeadingText>
    </Card.Heading>
    <Card.ParagraphText>
      Cards can use buttons for primary and secondary actions.
    </Card.ParagraphText>
  </Card.Content>
  <Card.Footer>
    <Card.Button variant="secondary">Cancel</Card.Button>
    <Card.Button variant="primary">Confirm</Card.Button>
  </Card.Footer>
</Card.Root>

Interactive

Set interactive on Card.Root to enable hover and pressed visual states on the content area. Use the render prop to make the root element to a <button> so screen readers know that the element is interactive.

WARNING

Interactive cards must not contain buttons, links, or input fields. React will yell at you if you nest interactive elements. Install the QUI React ESLint Plugin to enforce this in your project.

<Card.Root
  className="w-64"
  interactive
  render={<button />}
  variant="elevated"
>
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Interactive Card</Card.HeadingText>
    </Card.Heading>
    <Card.ParagraphText>
      Hover or press this card to see the interactive states.
    </Card.ParagraphText>
  </Card.Content>
</Card.Root>

Media

Use Card.Media to display an image or other visual content at the top of the card.

Qualcomm automotive technology
Automotive Platform
Next-gen connectivity
<Card.Root className="w-64" variant="outline">
  <Card.Media>
    <img
      alt="Qualcomm automotive technology"
      className="h-40 w-full"
      src="https://react.qui.qualcomm.com/images/auto-vertical-1.png"
    />
  </Card.Media>
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Automotive Platform</Card.HeadingText>
      <Card.SubheadingText>Next-gen connectivity</Card.SubheadingText>
    </Card.Heading>
  </Card.Content>
  <Card.Footer>
    <Card.Link endIcon={ChevronRight}>Learn More</Card.Link>
  </Card.Footer>
</Card.Root>

Badge

Use Card.Badge to place 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.

<Card.Root className="w-72" variant="outline">
  <Card.Badge>
    <Badge emphasis="brand">NEW</Badge>
  </Card.Badge>
  <Card.Content>
    <Card.Heading>
      <Card.HeadingText>Snapdragon X2 Elite</Card.HeadingText>
      <Card.SubheadingText>
        A legendary leap in performance
      </Card.SubheadingText>
    </Card.Heading>
    <Card.ParagraphText>
      Unleash your masterpiece with ultra-premium performance, multi-day
      battery life, and blazing AI processing power.
    </Card.ParagraphText>
  </Card.Content>
  <Card.Footer>
    <Card.Link endIcon={ChevronRight}>Learn More</Card.Link>
  </Card.Footer>
</Card.Root>

Alignment

Set alignment on Card.Root 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.

<Card.Root alignment={alignment} className="w-80" variant="outline">
  <Card.Content>
    <Card.Heading>
      <Card.EyebrowText>Eyebrow</Card.EyebrowText>
      <Card.HeadingText>Card Title</Card.HeadingText>
      <Card.SubheadingText>Subheading</Card.SubheadingText>
    </Card.Heading>
    <Card.ParagraphText>
      Toggle between start and center alignment to see how heading and
      footer content repositions.
    </Card.ParagraphText>
  </Card.Content>
  <Card.Footer>
    <Card.Button variant="secondary">Cancel</Card.Button>
    <Card.Button variant="primary">Confirm</Card.Button>
  </Card.Footer>
</Card.Root>

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.

<Card.Root size={size} style={{width}} variant="outline">
  <Card.Media>
    <Card.Avatar>
      <Avatar.Content icon={User} />
    </Card.Avatar>
  </Card.Media>
  <Card.Content>
    <Card.Heading>
      <Card.EyebrowText>Eyebrow</Card.EyebrowText>
      <Card.HeadingText>Card Title</Card.HeadingText>
    </Card.Heading>
    <Card.SubheadingText>Subheading</Card.SubheadingText>
    <Card.ParagraphText>
      Resize this card using the controls below to see how spacing and
      typography scale across sizes.
    </Card.ParagraphText>
  </Card.Content>
  <Card.Footer>
    <Card.Button variant="secondary">Cancel</Card.Button>
    <Card.Button variant="primary">Confirm</Card.Button>
  </Card.Footer>
</Card.Root>

Explorer

Eyebrow
Card Title
Subheading

A brief description that provides additional context about this card.

Learn more

API

<Card.Root>

The outer container for a card. Provides size and variant context to all child card parts. Renders a <div> element by default.
PropTypeDefault
The alignment of the card's content.
  • 'start': The content is aligned to the start of the card.
  • 'center': The content is centered horizontally within the card.
| 'start'
| 'center'
React children prop.
The document's text/writing direction.
'ltr' | 'rtl'
'ltr'
If true, the root of the card will be styled as a button with interactive states.
boolean
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The size of the card, controlling internal spacing and typography.
| 'sm'
| 'md'
| 'lg'
'sm'
The visual style of the card.
  • outline: The card has a border and a background color.
  • outline-elevated: The card has a border and a subtle elevation.
  • elevated: The card has a subtle elevation.
| 'outline'
| 'outline-elevated'
| 'elevated'
'outline'
Type
| 'start'
| 'center'
Description
The alignment of the card's content.
  • 'start': The content is aligned to the start of the card.
  • 'center': The content is centered horizontally within the card.
Description
React children prop.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
boolean
Description
If true, the root of the card will be styled as a button with interactive states.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the card, controlling internal spacing and typography.
Type
| 'outline'
| 'outline-elevated'
| 'elevated'
Description
The visual style of the card.
  • outline: The card has a border and a background color.
  • outline-elevated: The card has a border and a subtle elevation.
  • elevated: The card has a subtle elevation.

<Card.Media>

A media area at the top of the card for images, avatars, or other visual content. Renders a <div> element by default.
PropTypeDefault
React children prop.
The vertical padding of the media component.
'sm' | 'lg'
'sm'
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
'sm' | 'lg'
Description
The vertical padding of the media component.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.Avatar>

A slot for an avatar within the card. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.Badge>

A badge slot within the card, typically used to display a status or category badge. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.Content>

The main content area of the card that wraps text, headings, and other body content. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.Heading>

A container that wraps the eyebrow text, heading text, and optional menu trigger. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.EyebrowText>

A small label above the heading, typically used for categorization. Renders a <span> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.HeadingText>

The primary heading of the card. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.MenuTrigger>

A trigger area for an overflow menu within the card heading. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.SubheadingText>

A secondary heading below the main heading. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.ParagraphText>

A paragraph of body text within the card. Renders a <p> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
The bottom section of the card, typically for actions like buttons or links. Renders a <div> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

<Card.Button>

A button area within the card footer. Renders a <button> element by default.
PropType
React children prop.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The style variant of the button.
  • primary: reserved for the primary action of the card.
  • secondary: a secondary action denoted by a subtle outline style.
| 'primary'
| 'secondary'
Description
React children prop.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'primary'
| 'secondary'
Description
The style variant of the button.
  • primary: reserved for the primary action of the card.
  • secondary: a secondary action denoted by a subtle outline style.
A link within the card footer. Renders an <a> element by default.
PropTypeDefault
React children prop.
The document's text/writing direction.
'ltr' | 'rtl'
'ltr'
Controls whether the link is interactive. When true, pointer/focus events are blocked, and the link is visually dimmed.
boolean
Icon positioned after the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
| LucideIcon
| ReactNode
Controls whether the link inherits font size from its parent element.
boolean
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
| LucideIcon
| ReactNode
The style variant of the button.
  • primary: reserved for the primary link of the card.
  • secondary: a secondary link denoted by a subtle style.
| 'primary'
| 'secondary'
Description
React children prop.
Type
'ltr' | 'rtl'
Description
The document's text/writing direction.
Type
boolean
Description
Controls whether the link is interactive. When true, pointer/focus events are blocked, and the link is visually dimmed.
Type
| LucideIcon
| ReactNode
Description
Icon positioned after the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
Type
boolean
Description
Controls whether the link inherits font size from its parent element.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| LucideIcon
| ReactNode
Description
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
Type
| 'primary'
| 'secondary'
Description
The style variant of the button.
  • primary: reserved for the primary link of the card.
  • secondary: a secondary link denoted by a subtle style.
Last updated on by Ryan Bower