Skip to main content

molecules

Card

The base card, with a media figure, a body of heading, byline, and link, and optional metadata and video.

Specimens

Image card
james-zabiela_0.jpg

James Zabiela

Connecting a World-Famous DJ with His Fans

Winner of Best Music Site at SXSW.

Deliverables
Development, Interaction Design
{{ Card.render({
  title: "Connecting a World-Famous DJ with His Fans",
  byline: "James Zabiela",
  description: "Winner of Best Music Site at SXSW.",
  url: "/work/",
  meta: [
    {
      key: "Deliverables",
      value: "Development, Interaction Design"
    }
  ],
  image: (collections.projects | filterByKey("slug", "connecting-a-world-famous-dj-with-his-fans") | first).featuredImage
}) }}
Video card The video loads only when deferred-video scripting runs, so the poster still stands in here.

Connecting a World-Famous DJ with His Fans

{{ Card.render({
  title: "Connecting a World-Famous DJ with His Fans",
  url: "/work/",
  headingLevel: 4,
  image: (collections.projects | filterByKey("slug", "connecting-a-world-famous-dj-with-his-fans") | first).featuredImage,
  video: (collections.projects | filterByKey("slug", "connecting-a-world-famous-dj-with-his-fans") | first).featuredVideo
}) }}

Params

ParamTypeDescription
titlestringHeading text. Also the image alt fallback.
headingLevelnumberHeading level. Defaults to 3.
bylinestringSmall text rendered above the heading.
descriptionstringVisually hidden description (sr-only).
metaarrayRows of { key, value } passed to the stats molecule. Omitted when empty.
imageobject or stringSanity image (asset.url, asset.metadata.dimensions, alt), an object with src or url, or a URL string. Used as the media when there is no video. Width and height come from its dimensions.
videoobjectOptional. url (or videoUrl) plus poster.url. Replaces the image as the media; the image is the poster fallback. muted, loop, and autoplay are on unless set to false.
urlstringAdds a “View” link in the footer.
eagerbooleanLoads the image eagerly. Defaults to false (lazy).
classesstringAppended as-is to the root <article>. No classes filter.
stylesobjectSlot map. See the slot table.
SlotElement
imageThe media element: <img>, or <video> when video is set.

Notes

The description and metadata are visually hidden (sr-only).