GitHub

Card

Content container with header, body, footer, and image slots.

<rhx-card>

Examples

Basic

Product Name

A short description of the product. Great for showcasing items in a grid layout.

With Image

Random photo

Featured Article

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus lacinia odio vitae vestibulum.

Minimal

A simple card with just body content. No header, footer, or image required.

Card Grid

Card 1

Card 1 content goes here with some placeholder text.

Card 2

Card 2 content goes here with some placeholder text.

Card 3

Card 3 content goes here with some placeholder text.

Properties

Property Type Default Description
(slot) rhx-card-header - Optional header section rendered at the top of the card
(slot) rhx-card-footer - Optional footer section rendered at the bottom of the card
(slot) rhx-card-image - Optional top image with rhx-src and rhx-alt attributes

Accessibility

  • Renders as an <article> element, providing a semantic landmark for assistive technology.
  • A heading inside <rhx-card-header> gives the card an accessible name via the document outline.
  • Focusable cards (e.g. clickable cards) should include tabindex="0" and a keyboard handler.
  • Images in <rhx-card-image> require rhx-alt for meaningful alternative text.