Docs

Documentation versions (currently viewingVaadin 24)

Card

Styling API reference for the Card components.

Style Properties

The following style properties can be used in CSS stylesheets to customize the appearance of this component.

To apply values to these properties globally in your application UI, place them in a CSS block using the html {…​} selector. See Lumo Style Properties for more information on style properties.

Common Properties

Feature Property Default Value

Background

--vaadin-card-background

--lumo-shade-5pct

Box Shadow

--vaadin-card-box-shadow

none

Border Width

--vaadin-card-border-width

0

Border Color

--vaadin-card-border-color

--lumo-contrast-20pct

Border Radius

--vaadin-card-border-radius

--lumo-border-radius-l

Padding

--vaadin-card-padding

--lumo-space-m

Gap

--vaadin-card-gap

--lumo-space-m

Media Aspect Ratio

--vaadin-card-media-aspect-ratio

16/9, when the stretch-media or cover-media style variant is used without the horizontal style variant.

CSS Selectors

The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.

Root element

vaadin-card

Parts

Media

vaadin-card::part(media)

Header

vaadin-card::part(header)

Content

vaadin-card::part(content)

Footer

vaadin-card::part(footer)

Style Variants

Outlined

vaadin-card[theme~="outlined"]

Elevated

vaadin-card[theme~="elevated"]

Horizontal

vaadin-card[theme~="horizontal"]

Stretch Media

vaadin-card[theme~="stretch-media"]

Cover Media

vaadin-card[theme~="cover-media"]