Skip to main content
MessagingCard
@coinbase/cds-web@8.38.5
MessagingCard displays promotional or informational content with two variants: 'upsell' for promoting features with a primary background, and 'nudge' for encouraging actions with an alternate background. It replaces the deprecated NudgeCard and UpsellCard components.
import { MessagingCard } from '@coinbase/cds-web/cards/MessagingCard'
Related components

MessagingCard provides two card types for promotional and informational content. It replaces the deprecated NudgeCard and UpsellCard components.

Basic Types

Use type to set the card variant:

  • upsell: Primary background, used for promoting features or products
  • nudge: Alternate background, used for encouraging user actions
Loading...

Media Placement

Use mediaPlacement to control the position of media content.

Loading...

Features

Dismissible Cards

Use onDismiss to add a dismiss button.

Loading...

Tags

Use tag to add a label badge.

Loading...

Actions

Use actions to add action buttons.

Loading...

Complete Example

Combine all features in a complete card.

Loading...

Polymorphic and Interactive

MessagingCard supports polymorphic rendering with as and can be made interactive with renderAsPressable.

Loading...

Custom Content

Use React nodes for custom styled content.

Loading...

Multiple Cards

Display multiple cards in a carousel.

Loading...

Migration from Deprecated Components

Migrating from NudgeCard

Replace NudgeCard with MessagingCard using type="nudge".

// Before
<NudgeCard
title="Title"
description="Description"
pictogram="addToWatchlist"
action="Learn more"
onActionPress={handleAction}
onDismissPress={handleDismiss}
/>

// After
<MessagingCard
type="nudge"
title="Title"
description="Description"
media={<Pictogram dimension="48x48" name="addToWatchlist" />}
actions={<Button compact variant="tertiary" onClick={handleAction}>Learn more</Button>}
onDismiss={handleDismiss}
mediaPlacement="end"
/>

Migrating from UpsellCard

Replace UpsellCard with MessagingCard using type="upsell".

// Before
<UpsellCard
title="Title"
description="Description"
media={<RemoteImage ... />}
action="Get Started"
onActionPress={handleAction}
onDismissPress={handleDismiss}
/>

// After
<MessagingCard
type="upsell"
title="Title"
description="Description"
media={<RemoteImage ... />}
actions={<Button compact variant="secondary" onClick={handleAction}>Get Started</Button>}
onDismiss={handleDismiss}
mediaPlacement="end"
/>

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.