Composite

EventCard

An event card: date and time in the event’s zone, location, and a past badge.

Upcoming

Times show in timezone, with the zone name. On a collection page the helpers pass the event’s own zone, else collections.timezone from config.yaml.

May 20, 2030, 1:00 PM–5:00 PM EDT

Our guest baker from Brooklyn shows how to boil, seed and bake a proper bagel.

Example Loft, Brooklyn
  • workshop
  • guest
upcoming
---
import EventCard from '@alfadormx/blocks/composite/EventCard.astro';
---

<div class="max-w-sm">
  <EventCard
    headline={{ title: 'New York bagel workshop' }}
    href="/demos/local/events/new-york-workshop"
    description="Our guest baker from Brooklyn shows how to boil, seed and bake a proper bagel."
    start={new Date('2030-05-20T17:00:00Z')}
    end={new Date('2030-05-20T21:00:00Z')}
    timezone="America/New_York"
    location={{ name: 'Example Loft, Brooklyn' }}
    tags={['workshop', 'guest']}
  />
</div>

Past

past adds the badge. The page helpers set it at build time, so a static site needs a scheduled rebuild to move events into the past.

past
---
import EventCard from '@alfadormx/blocks/composite/EventCard.astro';
---

<div class="max-w-sm">
  <EventCard
    headline={{ title: 'Online sourdough class' }}
    href="/demos/local/events/accessibility-webinar"
    start={new Date('2026-02-04T15:00:00Z')}
    end={new Date('2026-02-04T16:00:00Z')}
    timezone="Europe/Madrid"
    location={{ name: 'Online' }}
    past
  />
</div>

API Reference

PropTypeDefaultDescription
headlineHeadlineProps—Card title; the title text is the card's one link and its accessible name (default: htmlTag 'h3').
hrefstring—Entry URL; the whole card is one link.
descriptionstring—Excerpt under the title.
imageImageProps—Cover image above the title.
tagsstring[]—Tags in the card footer (default: []).
langCodestring—Language of the card's dates and UI strings (default: the site's default language).
classstring—Classes on the card root (`data-entry-card`).
eyebrowClassstring—Classes on the eyebrow line above the title (`data-entry-card-eyebrow`).
tagsClassstring—Classes on the tags list (`data-entry-card-tags`).
startDate—Start date and time.
endDate—End date and time; a same-day end shows as a time range.
timezonestring'UTC'IANA time zone the times are shown in (default: 'UTC'; the page helpers pass the event's or the site's zone).
locationEntryLocation—Venue; its name leads the card footer.
pastbooleanfalseMarks the event as over and shows the past badge.
pastLabelstring—Text of the past badge (default: per-language "Past").
readMoreLabelstring—Visual "Read more" text; hidden from assistive tech, since the title is the link (default: per-language string).