Card

Basic Card

At its core an EuiCard should contain a title,description, and an icon. You can make the whole card clickable by giving it an onClick handler or href.

For accessibility and heading hierarchy, a card's title element is a span by default. However, this can be changed via the titleElement prop without altering the visual size.

Example of a card's description. Stick to one or two sentences.

Example of a card's description. Stick to one or two sentences.

Example of a card's description. Stick to one or two sentences.

Example of a card's description. Stick to one or two sentences.

Layout

Most of the time, cards should read from top to bottom (vertical). However, in some cases, you may want the icon to be to the left of the content. In this case, add the prop layout="horizontal". Works best when the icon is size xl.

Horizontal layouts do not work with images, footers, or textAlign. Therefore, these properties will be ignored.

This card adds uses an 'xl' size icon which works well in a horizontal layout.

This card uses an 'l' size icon but also shrinks the 'titleSize' to 'xs'.

No icon example

Example of a card's description. Stick to one or two sentences.

Images

Images can be added in place of, or in conjuction with, icons. Just pass a url into the image prop and it will expand to the edges of the card.

Make sure that all images are the same proportions when used in a singular row.
Elastic in Nature

Example of a card's description. Stick to one or two sentences.

Elastic in Water

Example of a card's description. Stick to one or two sentences.

Beats in the City

This card has an href and should be a link.

Beta badge

If the card links to or references a module that is not GA (beta, lab, etc), you can add a betaBadgeLabel and betaBadgeTooltipContent to the card and it will properly create and position an EuiBetaBadge. If you want to change the title of the tooltip, supply a betaBadgeTitle prop.

Example of a card's description. Stick to one or two sentences.

Example of a card's description. Stick to one or two sentences.

Beta

Example of a card's description. Stick to one or two sentences.

Lab

Selectable

When you have a list of cards that can be selected but do not navigate anywhere, you can add the selectable prop. The prop is an object that extends EuiButtonEmpty. It will apply the button as seen below, and passing selectable.isSelected = true will alter the styles of the card and button to look selected.

When providing an extra link to more details or such, be sure to stop event propagation from also selecting the card.
Sketch

Example of a short card description.

Google

Example of a longer card description. See how the footers stay lined up.

Not Adobe

Example of a short card description.

Custom children

In the event that you need more than just paragraph text for the description, you can pass anything you need as the children of the component.

Lists

Wrap a lists with EuiText size="s" to match the description text.

  • Bullet 1
  • Bullet 2
  • Bullet 3
Form controls

Add any controls you need.

Just about anything

Just be sure not to add any onClick handler to the card if the children are also interactable.

<yoda>Hello, young Skywalker</yoda>