Card
A bordered container for a related group of content.
Example
Northwind Studio
26 projects, 9 members.
Updated October 3
<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>import { Card } from '@focsd-dev/react';
export function Example() { return <Card>…</Card>;}<script setup>import '@focsd-dev/components/focsd-card.js';</script>
<template> <focsd-card>…</focsd-card></template>// Add CUSTOM_ELEMENTS_SCHEMA to the component's schemas, then:import '@focsd-dev/components/focsd-card.js';
// template<focsd-card>…</focsd-card><script> import '@focsd-dev/components/focsd-card.js';</script>
<focsd-card>…</focsd-card>API
Attributes
| Attribute | Property | Type | Default |
|---|---|---|---|
variant | variant | 'outlined' | 'sunk' | outlined |
Slots
| Slot | Description |
|---|---|
(default) | Default content. |
footer | Content at the bottom of the card, such as actions. |
header | Content 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).
| Part | Description |
|---|---|
body | The body element. |
card | The card element. |
footer | The footer element. |
header | The header element. |
Accessibility
- A plain container with no landmark or
articlerole; wrap it in<article>yourself when the card is a self-contained item. - Do not nest cards.
Ask the docs
Hi, what are you building?
Ask about any component, theming, forms or frameworks. I answer with the right component, a snippet and a link to its docs.