Skip to main content
Our new developer certification is live!

Persons

Renders a list of person cards using the AuthorCard component. Supports Person content type.

Props

PropTypeRequiredDefaultDescription
authorsPerson[]Yes-Array of person objects from Contentstack
cslpCSLPFieldMappingNo-CSLP mapping for editable fields
classNamestringNo''Additional CSS classes for the container
labelstringNo'Author'Label text to display above person name (e.g., "Author", "Host", "Guest")

Usage

import Persons from '@/components/organisms/Persons';

<Persons 
  authors={[
    { title: "John Doe", url: "/person/john-doe", ... },
    { title: "Jane Smith", url: "/person/jane-smith", ... }
  ]}
  className="mb-8"
/>

Features

  • Renders multiple person cards in a flex wrap layout
  • Returns null if authors array is empty or undefined
  • Supports custom className for styling
  • Customizable label based on field name (defaults to "Author", can be set to "Host", "Guest", etc.)
  • Uses AuthorCard component internally
  • Supports Person content type

Custom Labels

The label prop allows you to customize the text displayed above each person's name based on the field name:

// Default: "Author"
<Persons authors={authors} />

// Custom: "Host" (for live stream hosts)
<Persons authors={hosts} label="Host" />

// Custom: "Guest" (for live stream guests)
<Persons authors={guests} label="Guest" />

Notes

  • Each person card is wrapped with gap-4 spacing
  • Uses flex-wrap for responsive layout
  • The component name was changed from Authors to Persons to better reflect support for Person content type