Skip to main content

Card

shadow

The Card element is a flexible and expandable card format container. It allows you to display a wide range of content and consists of a CardHeader and a CardContent header.

Basic usage

Separator

The separator property is used to display a horizontal separator in the Card Header element.

Card with picture

Card with list

Styling

Preset color variants of the element Card

The color property adjusts the background and border color of the card. Setting this value will change the button color to one of the colors in the preset color palette. By default, the element has a primary background.

CSS Custom Properties

<wje-card id="custom">
<wje-card-header>
<wje-card-subtitle>Subtitle</wje-card-subtitle>
<wje-card-title>Title</wje-card-title>
</wje-card-header>
<wje-card-content> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </wje-card-content>
</wje-card>
<style>
#custom {
--wje-card-margin-top: 1rem;
--wje-card-margin-bottom: 1rem;
--wje-card-margin-inline: 1rem;
--wj-color-contrast: #f0f;
--wje-card-border-color: #000;
--wj-border-size: 2px;
--background-color: #000 !important;
--wj-font-size: 0.8rem;
--wj-border-radius: 0;
}
</style>

When to use

Use wje-card to improve readability, scannability, and contextual understanding of content.

When not to use

Do not replace structured interactive data with media-only presentation when precision is needed.

Accessibility

Provide alt text, maintain readable contrast, and include text equivalents for icon-only controls.

Best Practices

  • Compress media and use lazy loading in larger collections.
  • Keep information priority consistent across cards/lists.
  • Avoid duplicating the same meaning in icon and text without added value.

Attributes and Properties

label

DescriptionSets the user-visible or accessible label text.
Attributelabel
Typeany
Default-

ariaLabel

DescriptionSets ARIA metadata used to improve accessibility semantics for assistive technologies.
Attributearia-label
Typeany
Default-

ariaLabelledby

DescriptionSets ARIA metadata used to improve accessibility semantics for assistive technologies.
Attributearia-labelledby
Typeany
Default-

Events

No events available for this component.

Methods

No public methods available for this component.

CSS Shadow Parts

No CSS shadow parts available for this component.

CSS Custom Properties

NameDescription
--wje-card-backgroundBackground of the component;.
--wje-card-colorColor of the component;.
--wje-card-border-colorBorder color of the component;.
--wje-card-border-styleBorder style of the component;.
--wje-card-border-widthBorder width of the component;.
--wje-card-border-radiusBorder radius of the component;.
--wje-card-shadowShadow of the component;.

Slots

NameDescription
defaultDefault slot for the main component content.