GitHub

EventCard

A card block for displaying events with status badges, metadata, speakers, and action buttons.

Loading...

Installation

pnpm add @corew500/ui

Usage

import { EventCard } from '@corew500/ui/blocks/event-card'

<EventCard
  title="Design Systems Workshop"
  description="Learn to build scalable design systems."
  status="upcoming"
  metadata={{
    date: 'March 22, 2026',
    time: '2:00 PM EST',
    location: 'Virtual',
  }}
  format={{ label: 'Webinar' }}
  speakers={[
    { name: 'Jane Doe', title: 'Lead Engineer' },
  ]}
  action={{ label: 'Register Now', href: '/register' }}
/>

Status Types

| Status | Description | |--------|-------------| | upcoming | Event is scheduled in the future | | live | Event is currently in progress | | recorded | Event has a recording available | | past | Event has ended |

API Reference

Props

PropTypeDefaultDescription
title*stringEvent title
descriptionstringEvent description
statusenumEvent status
image{ src: string; alt: string; }Optional hero image (simple img tag)
imageSlotenumCustom image slot for framework-specific images (e.g., Next.js Image) Takes precedence over `image` prop when provided
fallbackIconenumFallback icon component to show when no image is provided
metadataEventMetadataEvent metadata (date, time, location)
formatEventFormatEvent format/type (e.g., "Webinar", "In-Person")
speakersEventSpeaker[]List of speakers
actionEventActionPrimary action button
secondaryActionEventActionSecondary action button
customBadgeenumCustom badge content (ReactNode or object with animated option)
translationsEventCardTranslationsi18n translations object
statusLabelsPartial<Record<EventStatus, string>>@deprecated Use translations.status instead i18n labels for status badges
variantenumdefault
orientationenumvertical
layoutenumstack

Accessibility

Screen Readers

  • - Metadata icons use aria-hidden="true" as they are decorative
  • Format icon uses aria-hidden="true" when present

Additional

  • Action buttons render as proper anchor elements when href provided
  • Card structure uses semantic heading for title
  • Status badges convey meaning through text, not just color

Localization

Translatable Content

  • - Component accepts pre-resolved translated strings
  • All user-facing text is customizable via props:
  • `title`, `description` - Event header text
  • `action.label`, `secondaryAction.label` - Button text
  • `translations.status` - Status badge labels
  • `translations.metadata` - Metadata field labels
  • `translations.speakers` - Speaker section labels and conjunctions
  • Deprecated `statusLabels` prop maintained for backward compatibility

Locale-Specific Formatting

  • `metadata` - Date/time/location values
  • `speakers[].name`, `speakers[].title` - Speaker information
  • `format.label` - Event format label