Card

Material Design 3 card web component (elevated, filled, outlined; optionally interactive).

  • 2.4 KB gzipped
  • @lit-material/card 0.0.4
  • Renders on the server

Example

Install

npm install @lit-material/card @lit-material/tokens
import "@lit-material/card";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-card>

Material Design 3 card.

Properties

PropertyAttributeTypeDefaultDescription
variantvariantCardVariant"elevated"
interactiveinteractivebooleanfalseMakes the whole card a single clickable/tappable surface. Implied by setting href.
disableddisabledbooleanfalse
typetypeCardType"button"
namenamestring""
valuevaluestring""
formformstring | undefinednone
hrefhrefstring""If set, renders the card as a link (<a>) instead of a <button>; implies interactive.
targettargetstring""

Slots

SlotDescription
defaultThe card's content.

CSS parts

PartDescription
cardThe <div>, <button>, or <a> surface (background/border/elevation).
rippleThe state-layer element the hover/press feedback is drawn on. Only rendered when interactive.
focus-ringThe focus indicator element. Only rendered when interactive.

Source on GitHub npm