Skip to content
Focsd homeFocsd homeFocsd
Forms

Card

A bordered container for a related group of content.

  • Tag: focsd-card
  • Pattern: Static (article/section)
  • Category: Display

Example

Northwind Studio

26 projects, 9 members.

Updated October 3

HTML
<focsd-card>
<h3 slot="header">Northwind Studio</h3>
<p>26 projects, 9 members.</p>
<p slot="footer">Updated October 3</p>
</focsd-card>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-card.js';
</script>
<focsd-card>…</focsd-card>

API

Attributes

AttributePropertyTypeDefault
variantvariant'outlined' | 'sunk'outlined

Slots

SlotDescription
(default)Default content.
footerContent at the bottom of the card, such as actions.
headerContent at the top of the card, such as a heading.

CSS parts

Style the inside of the component with ::part(), for example focsd-card::part(body).

PartDescription
bodyThe body element.
cardThe card element.
footerThe footer element.
headerThe header element.

Accessibility

  • A plain container with no landmark or article role; wrap it in <article> yourself when the card is a self-contained item.
  • Do not nest cards.