Skip to main contentGatsby theme Carbon

ImageCard

The

<ImageCard>
component should generally be used inside of a
<Row className="image-card-group">
and
<Column>
component. This allows us to properly space the
<Column>
components when they wrap on mobile.

Example

Code

<Row className="image-card-group">
<Column colMd={4} colLg={4} noGutterSm>
<ImageCard title="Title" subTitle="Subtitle" href="/">
![Square](/images/square.jpg)
</ImageCard>
<ImageCard
title="Dark title"
titleColor="dark"
aspectRatio="1:1"
href="/"
actionIcon="arrowRight"
subTitleColor="dark"
subTitle="Dark subtitle">
![Light dark](./images/light-dark.jpg)
</ImageCard>
</Column>
<Column colMd={4} colLg={4} noGutterSm>
<ImageCard
title="Title"
subTitle="Subtitle"
aspectRatio="1:2"
href="/"
actionIcon="download"
titleColor="light"
subTitleColor="light">
![Plane image](./images/plane.jpg)
</ImageCard>
</Column>
<Column colMd={4} colLg={4} noGutterSm>
<ImageCard aspectRatio="1:1" href="/" hoverColor="dark">
![color pallete array](/images/color-grid.svg)
</ImageCard>
<ImageCard disabled aspectRatio="1:1" href="/">
![Square](/images/square.jpg)
</ImageCard>
</Column>
</Row>

Props

propertypropTyperequireddefaultdescription
childrennodeBackground image for the card, make sure it is saved out at the correct aspect ratio or it will appear distorted
hrefstringSet url for card
aspectRatiostring
1:1
Set card aspect ratio, default is
1:1
, options are
1:1
,
16:9
,
4:3
,
2:1
,
1:2
subTitlestringSmaller title on top left of card
titlestringLarge title
actionIconstringAction icon, default is no icon, options are
Launch
,
ArrowRight
,
Download
,
Disabled
,
Email
titleColorstring
light
Set title text color, default is
light
, options are
light
or
dark
subTitleColorstring
light
Set sub title text color, default is
light
, options are
light
or
dark
iconColorstring
light
Set icon color, default is
light
, options are
light
or
dark
hoverColorstring
light
Set hover to lighten or darken the image, default is
light
, options are
light
or
dark
disabledbool
false
Set for disabled card
classNamestringAdd custom class name