AuthorCard
Displays a single person card with avatar image, name, and optional link.
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
author | Person | Yes | - | Person object from Contentstack containing title, url, and metadata |
cslp | CSLPFieldMapping | No | - | CSLP mapping for editable fields (Contentstack Live Preview) |
label | string | No | 'Author' | Label text to display above person name (e.g., "Author", "Participant") |
Usage
import AuthorCard from '@/components/molecules/AuthorCard';
<AuthorCard
author={{
title: "John Doe",
url: "/person/john-doe",
metadata: {
image: {
url: "/images/person.jpg",
title: "John Doe"
}
}
}}
/>Features
- Displays person avatar (40x40px, rounded)
- Customizable label (defaults to "Author", can be set to "Participant" for live streams)
- Links to person page if URL is provided
- Supports CSLP for live preview editing
Custom Labels
The label prop allows you to customize the text displayed above the author's name:
// Default: "Author"
<AuthorCard author={author} />
// Custom: "Participant"
<AuthorCard author={author} label="Participant" />Notes
- Returns
nullif no person image is provided - Avatar is displayed as a circular image
- Label uses
cs-xs-bodyand person name usescs-h6typography variants