diff --git a/packages/unity-react-core/src/components/Card/Card.jsx b/packages/unity-react-core/src/components/Card/Card.jsx
index 73ce9519f6..2ce1940eb0 100644
--- a/packages/unity-react-core/src/components/Card/Card.jsx
+++ b/packages/unity-react-core/src/components/Card/Card.jsx
@@ -321,6 +321,7 @@ const CardContent = ({
) : (
<>
+ {(!title && !body && !showEventInfo) &&
}
{buttons && (
{buttons.map(button => (
diff --git a/packages/unity-react-core/src/components/CardArrangement/CardArrangement.stories.jsx b/packages/unity-react-core/src/components/CardArrangement/CardArrangement.stories.jsx
index 8da187e042..f63ad544b9 100644
--- a/packages/unity-react-core/src/components/CardArrangement/CardArrangement.stories.jsx
+++ b/packages/unity-react-core/src/components/CardArrangement/CardArrangement.stories.jsx
@@ -225,6 +225,39 @@ const imageCards = [
},
];
+const imageButtonCards = [
+ {
+ type: "default",
+ image: img1,
+ alt: "Image button card 1",
+ title: "Example",
+ body: "This is the body content for the first card.",
+ buttons: [
+ {
+ color: "gold",
+ size: "default",
+ label: "Explore",
+ ariaLabel: "Explore",
+ href: "#",
+ },
+ ],
+ },
+ {
+ type: "default",
+ image: img1,
+ alt: "Image button card 2",
+ buttons: [
+ {
+ color: "gold",
+ size: "default",
+ label: "Explore",
+ ariaLabel: "Explore",
+ href: "#",
+ }
+ ]
+ },
+];
+
const Template = args => (
@@ -641,3 +674,27 @@ Example with image cards that display a visual representation along with heading
},
},
};
+
+export const ImageButtonCards = Template.bind({});
+ImageButtonCards.args = {
+ cards: imageButtonCards,
+ cardType: "default",
+ columns: 2,
+};
+ImageButtonCards.storyName = "Cards with image and buttons";
+ImageButtonCards.parameters = {
+ docs: {
+ description: {
+ story: `
+Example with cards that display a visual representation along with a button.
+
+\`\`\`jsx
+
+\`\`\`
+ `,
+ },
+ },
+};
diff --git a/packages/unity-react-core/src/components/Image/Image.jsx b/packages/unity-react-core/src/components/Image/Image.jsx
index 485094821c..781fad4d97 100644
--- a/packages/unity-react-core/src/components/Image/Image.jsx
+++ b/packages/unity-react-core/src/components/Image/Image.jsx
@@ -2,6 +2,7 @@ import { spreadClasses, sanitizeDangerousMarkup } from "@asu/shared";
import classNames from "classnames";
import PropTypes from "prop-types";
import React from "react";
+import { Button } from "../Button/Button";
// @ts-ignore
@@ -32,6 +33,7 @@ export const Image = ({
title,
caption,
captionTitle,
+ buttons,
border,
dropShadow,
}) => {
@@ -67,26 +69,57 @@ export const Image = ({
);
};
- const renderFigure = () => (
-
-
- {renderImage()}
- {caption && (
-
- {captionTitle && {captionTitle}
}
-
-
+ const renderButtons = () => {
+ return (
+ <>
+ {buttons && (
+
+ {buttons.map(button => (
+
+
+
+ ))}
+
)}
-
-
- );
+ >
+ );
+ };
+
+ const renderFigure = () => {
+ return (
+
+
+ {renderImage()}
+
+ {captionTitle && {captionTitle}
}
+ {caption &&
+ }
+ {renderButtons()}
+
+
+
+ );
+ };
+
+ return buttons || caption ? renderFigure() : renderImage(borderAndDropShadowClasses);
- return (
- <>{caption ? renderFigure() : renderImage(borderAndDropShadowClasses)}>
- );
};
Image.propTypes = {
diff --git a/packages/unity-react-core/src/core/types/image-types.js b/packages/unity-react-core/src/core/types/image-types.js
index d46ecf0f5f..492c5c2f4a 100644
--- a/packages/unity-react-core/src/core/types/image-types.js
+++ b/packages/unity-react-core/src/core/types/image-types.js
@@ -1,5 +1,9 @@
// @ts-check
+/**
+ * @typedef {import('./shared-types').ButtonProps} ButtonProps
+ */
+
/**
* @typedef {Object} ImageComponentProps
* @property {string} src
@@ -15,6 +19,7 @@
* @property {string} [title]
* @property {string} [caption]
* @property {string} [captionTitle]
+ * @property {ButtonProps[]} [buttons]
* @property {boolean} [border]
* @property {boolean} [dropShadow]
*/