Composable Card

A general content surface with optional media, header, actions and footer slots. Use semantic content in each slot and choose heading levels to match the page. The card does not invent button or link behavior: place named native links or QDS actions in its actions/body/footer slots.

Usage

<script type="module" src="/assets/components/card/qds-card.js"></script>
<qds-card label="Company investment snapshot">
  <h2 slot="header">Redwood Basin Resources</h2>
  <a slot="actions" href="/companies">All companies</a>
  <dl><dt>Invested capital</dt><dd>$75 million</dd></dl>
  <p slot="footer">Fictional portfolio data</p>
</qds-card>

API

Property / attribute Type Default Meaning
label string empty Optional accessible name of the article.
Slot Content
default Arbitrary body content; forms and nested components retain their DOM and state.
media Optional media with its own accessible alternative.
header Heading or contextual header.
actions Named links/buttons next to the header.
footer Supplementary information or actions.

Unused optional regions are hidden. Adding, removing, or reassigning slot content updates the layout. The card has no custom events or focus stop; its links and controls keep their native semantics. Disconnect/reconnect preserves child content and removes/reinstates its slot listener.

Styling and accessibility

Parts: surface, media, header, body, footer. Optional CSS properties --qds-card-radius (8px) and --qds-card-padding (16px) customize local geometry. Existing QDS background, text and border tokens provide both themes. Long content wraps; media should have appropriate sizing and alt text. Give interactive children accessible names and minimum 44px targets.

Angular business example

The generated QdsCardComponent projects the same slots. Northwind’s company-detail screen uses the surface for an investment snapshot with live fixture metrics and an All companies navigation action. See /#/portfolio/companies/co-redwood in the Quangular app. This is fictional local fixture data, not investment guidance or a live portfolio.