TextPairing

A versatile component for displaying a headline with optional body text and add-ons. TextPairing is the building block for list items, cards, and other compound components.

Props

PropTypeRequiredDefaultDescription
headlineReactNodeYes-Primary text content
bodyReactNodeNo-Secondary text below headline
headlineColorTextColorNo"primary"Headline text color
headlineSizeSizeNo"medium"Headline text size
headlineBoldbooleanNofalseBold headline text
headlineAddOnReactNodeNo-Element displayed after headline
bodyColorTextColorNo"secondary"Body text color
bodySizeSizeNo"medium"Body text size
bodyEllipsisbooleanNofalseTruncate the body to one line
addOnReactNodeNo-Element displayed beside the text content
addOnPosition"start" | "end"No"start"Add-on placement
gapGapNo"medium"Space between add-on and text
paddingPaddingNo-Internal padding
alignAlignNo"stretch"Vertical alignment
growbooleanNofalseAllow component to grow
shrinkbooleanNofalseAllow component to shrink

Basic usage

At its simplest, TextPairing displays a headline and body text vertically stacked. Body text wraps by default. Dense compounds such as ListItem opt into single-line truncation explicitly.

Headline
Body text goes here
Bold headline
With supporting body text
<TextPairing headline="Headline" body="Body text" />

<TextPairing
  headline="Bold headline"
  headlineBold
  body="With supporting body text"
/>

Customizing text styles

Control the size and color of both headline and body independently.

Large headline
Smaller subtle body
Highlight headline
Secondary body text
<TextPairing
  headline="Large headline"
  headlineSize="large"
  headlineBold
  body="Smaller subtle body"
  bodySize="small"
  bodyColor="subtle"
/>

<TextPairing
  headline="Highlight headline"
  headlineColor="highlight"
  body="Secondary body text"
/>

With add-on

Add icons, avatars, or other elements alongside the text content. Control placement with addOnPosition.

Notification
You have a new message
Settings
Configure your preferences
// Add-on at start (default)
<TextPairing
  headline="Notification"
  body="You have a new message"
  addOn={<Icon icon="bell" color="highlight" size="large" />}
  gap="medium"
/>

// Add-on at end
<TextPairing
  headline="Settings"
  body="Configure your preferences"
  addOn={<Icon icon="settings" color="secondary" size="large" />}
  addOnPosition="end"
  gap="medium"
/>

With headline add-on

Place small elements directly after the headline text, such as badges or status indicators.

New feature
Check out what's new
<TextPairing
  headline="New feature"
  headlineBold
  headlineAddOn={<Icon icon="star" color="highlight" size="small" />}
  body="Check out what's new"
/>

Complete example

Combining all options for a rich list item appearance.

John Doe
Senior Software Engineer
<TextPairing
  headline="John Doe"
  headlineBold
  headlineSize="large"
  headlineAddOn={<Icon icon="circle-check" color="highlight" size="small" />}
  body="Senior Software Engineer"
  bodyColor="subtle"
  bodySize="small"
  addOn={<Icon icon="user" color="primary" size="xlarge" />}
  gap="medium"
  padding="medium"
/>

Use cases

TextPairing is commonly used within:

  • List items - Display title and description with icons
  • Cards - Header sections with titles and subtitles
  • Navigation - Menu items with labels and descriptions
  • Settings - Option labels with explanatory text