diff --git a/packages/example/src/data/nav-items.yaml b/packages/example/src/data/nav-items.yaml
index 0995f5f96..d3c09c736 100644
--- a/packages/example/src/data/nav-items.yaml
+++ b/packages/example/src/data/nav-items.yaml
@@ -42,6 +42,8 @@
path: /components/DoDontRow
- title: FeatureCard
path: /components/FeatureCard
+ - title: GifPlayer
+ path: /components/GifPlayer
- title: Grid
path: /components/Grid
- title: ImageCard
diff --git a/packages/example/src/pages/components/GifPlayer.mdx b/packages/example/src/pages/components/GifPlayer.mdx
new file mode 100644
index 000000000..e27e27383
--- /dev/null
+++ b/packages/example/src/pages/components/GifPlayer.mdx
@@ -0,0 +1,83 @@
+---
+title: GifPlayer
+description: Usage instructions for the Accordion component
+---
+
+
+
+The `` component is used to pause and play images that are gif's. It works by replacing the gif with a static image on pause.
+
+
+
+## Example
+
+
+
+
+Light
+
+
+
+![IBM Cloud Pictograms](/images/IBM_Cloud_Pictograms.gif)
+![IBM Cloud Pictograms](/images/IBM_Cloud_Pictograms.png)
+
+
+
+
+
+
+
+
+
+Dark
+
+
+
+![IBM Cloud Platform Prototype](/images/IBM_Cloud_Platform_Prototype.gif)
+![IBM Cloud Platform Prototype](/images/IBM_Cloud_Platform_Prototype.png)
+
+
+
+
+
+## Code
+
+Place two images inside of the GifPlayer component. The first image will be used as the gif, the second image will be used as the static image on pause. Only provide two images inside the component, do not place any other children inside the component.
+
+
Light
+
+```jsx path=components/GifPlayer/GifPlayer.js src= https://github.com/carbon-design-system/gatsby-theme-carbon/tree/master/packages/gatsby-theme-carbon/src/components/GifPlayer
+
+
+
+
+![IBM Cloud Pictograms](/images/IBM_Cloud_Pictograms.gif) // must be gif
+![IBM Cloud Pictograms](/images/IBM_Cloud_Pictograms.png) // must be static image
+
+
+
+
+```
+
+Dark
+
+```jsx path=components/GifPlayer/GifPlayer.js src= https://github.com/carbon-design-system/gatsby-theme-carbon/tree/master/packages/gatsby-theme-carbon/src/components/GifPlayer
+
+
+
+
+![IBM Cloud Platform Prototype](/images/IBM_Cloud_Platform_Prototype.gif) // must be gif
+![IBM Cloud Platform Prototype](/images/IBM_Cloud_Platform_Prototype.png) //must be static image
+
+
+
+
+```
+
+### Props
+
+| property | propType | required | default | description |
+| --------- | -------- | -------- | ------- | --------------------- |
+| children | node | yes | | Pass in the images that will be rendered. Only pass in the images, no other children |
+| color | string | | `light` | Specify if the icon color should be light or dark |
+| className | string | | | Specify an optional className to be applied to the container node |
diff --git a/packages/example/src/pages/components/ImageGallery.mdx b/packages/example/src/pages/components/ImageGallery.mdx
index f914cc44c..bc8b2cf85 100644
--- a/packages/example/src/pages/components/ImageGallery.mdx
+++ b/packages/example/src/pages/components/ImageGallery.mdx
@@ -48,12 +48,22 @@ Click on an image to open the gallery.
+
+
![IBM Cloud Platform Prototype](/images/IBM_Cloud_Platform_Prototype.gif)
+![IBM Cloud Platform Prototype](/images/IBM_Cloud_Platform_Prototype.png)
+
+
+
+
![IBM Cloud Pictograms](/images/IBM_Cloud_Pictograms.gif)
+![IBM Cloud Pictograms](/images/IBM_Cloud_Pictograms.png)
+
+
@@ -67,7 +77,7 @@ Click on an image to open the gallery.
-
+
![IBM Cloud Think](/images/IBM_Cloud_Think_Keynote.jpg)
diff --git a/packages/example/src/pages/components/images/IBM_Cloud_Pictograms.png b/packages/example/src/pages/components/images/IBM_Cloud_Pictograms.png
new file mode 100644
index 000000000..91ab18f94
Binary files /dev/null and b/packages/example/src/pages/components/images/IBM_Cloud_Pictograms.png differ
diff --git a/packages/example/src/pages/components/images/IBM_Cloud_Platform_Prototype.png b/packages/example/src/pages/components/images/IBM_Cloud_Platform_Prototype.png
new file mode 100644
index 000000000..ead0fc438
Binary files /dev/null and b/packages/example/src/pages/components/images/IBM_Cloud_Platform_Prototype.png differ
diff --git a/packages/gatsby-theme-carbon/index.js b/packages/gatsby-theme-carbon/index.js
index 094a9ffc6..2ed7abfa4 100644
--- a/packages/gatsby-theme-carbon/index.js
+++ b/packages/gatsby-theme-carbon/index.js
@@ -4,6 +4,7 @@ export { AnchorLinks, AnchorLink } from './src/components/AnchorLinks';
export { default as PageDescription } from './src/components/PageDescription';
export { default as Video } from './src/components/Video/Video';
export { default as DoDontExample } from './src/components/DoDontExample';
+export { default as GifPlayer } from './src/components/GifPlayer';
export { Row, Column, Grid } from './src/components/Grid';
export { default as Caption } from './src/components/Caption';
export { default as ResourceCard } from './src/components/ResourceCard';
diff --git a/packages/gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.js b/packages/gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.js
new file mode 100644
index 000000000..c236f1fba
--- /dev/null
+++ b/packages/gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.js
@@ -0,0 +1,106 @@
+import React, { useState } from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+import {
+ PlayOutline24,
+ PlayOutlineFilled24,
+ PauseOutline24,
+ PauseOutlineFilled24,
+} from '@carbon/icons-react';
+import styles from './GifPlayer.module.scss';
+
+const Pause = ({ hovering }) =>
+ hovering ? : ;
+
+const Play = ({ hovering }) =>
+ hovering ? : ;
+
+const ToggleIcon = ({ paused, hovering }) =>
+ paused ? : ;
+
+const GifPlayer = ({ children, color, className, isInDialog }) => {
+ const [paused, setPaused] = useState(false);
+ const [hovering, setHovering] = useState(false);
+
+ const onClick = () => {
+ setPaused(!paused);
+ };
+
+ const controlsClassNames = classnames({
+ [styles.controls]: true,
+ [styles.dark]: color === 'dark',
+ });
+
+ const containerClassNames = classnames({
+ [styles.container]: true,
+ [className]: className,
+ [styles.gifInDialog]: isInDialog,
+ });
+
+ const staticImageClassNames = classnames({
+ [styles.imgHidden]: true,
+ [styles.imgDisplayed]: paused,
+ });
+
+ const gifClassNames = classnames({
+ [styles.gifDisplayed]: true,
+ [styles.gifHidden]: paused,
+ });
+
+ const childrenArray = React.Children.toArray(children);
+
+ const labelText = paused
+ ? 'Toggleable animation paused'
+ : 'Toggleable animation playing';
+
+ return (
+
+
+ {childrenArray[0]}
+
+
+ {childrenArray[1]}
+
+
+
+ );
+};
+
+GifPlayer.propTypes = {
+ /**
+ * Specify if icon color should be "dark" or "light"
+ */
+ color: PropTypes.string,
+ /**
+ * Specify optional className
+ */
+ className: PropTypes.string,
+ /**
+ * Only pass in the 2 images to be rendered, first must be gif, second must be static image
+ */
+ children: PropTypes.arrayOf(PropTypes.element).isRequired,
+ /**
+ * Specify if the gifPlayer is inside the expanded ImageGallery (see ImageGallery.js)
+ */
+ isInDialog: PropTypes.bool,
+};
+
+GifPlayer.defaultProps = {
+ color: 'light',
+ isInDialog: false,
+};
+
+export default GifPlayer;
diff --git a/packages/gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.module.scss b/packages/gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.module.scss
new file mode 100644
index 000000000..915091899
--- /dev/null
+++ b/packages/gatsby-theme-carbon/src/components/GifPlayer/GifPlayer.module.scss
@@ -0,0 +1,52 @@
+.container {
+ position: relative;
+}
+
+.controls {
+ position: absolute;
+ bottom: 1rem;
+ left: 1rem;
+ height: 1.5rem;
+ width: 1.5rem;
+ background: transparent;
+ outline: none;
+ border: none;
+ padding: 0;
+}
+
+.controls svg {
+ fill: white;
+}
+
+.dark svg {
+ fill: black;
+}
+
+.controls:focus svg {
+ outline: 2px solid $focus;
+ outline-offset: -2px;
+}
+
+//toggle static image
+.img-hidden {
+ display: none;
+}
+
+.img-displayed {
+ display: block;
+}
+
+//toggle gif
+.gif-displayed {
+ display: block;
+}
+
+.gif-hidden {
+ display: none;
+}
+
+//styles for gif player in image gallery
+.gif-in-dialog {
+ top: 50%;
+ transform: translateY(-50%);
+}
diff --git a/packages/gatsby-theme-carbon/src/components/GifPlayer/index.js b/packages/gatsby-theme-carbon/src/components/GifPlayer/index.js
new file mode 100644
index 000000000..09c1966d4
--- /dev/null
+++ b/packages/gatsby-theme-carbon/src/components/GifPlayer/index.js
@@ -0,0 +1,3 @@
+import GifPlayer from './GifPlayer';
+
+export default GifPlayer;
diff --git a/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGallery.js b/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGallery.js
index fbcb95ddd..33c8c5fb0 100644
--- a/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGallery.js
+++ b/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGallery.js
@@ -162,9 +162,17 @@ function ImageGallery({ children }) {
)}
- {React.cloneElement(childrenAsArray[activeImageIndex], {
- isInDialog: true,
- })}
+ {childrenAsArray[activeImageIndex].props.children.props
+ .mdxType === 'GifPlayer'
+ ? React.cloneElement(
+ childrenAsArray[activeImageIndex].props.children,
+ {
+ isInDialog: true,
+ }
+ )
+ : React.cloneElement(childrenAsArray[activeImageIndex], {
+ isInDialog: true,
+ })}
{activeImageIndex + 1 < childrenAsArray.length && (
diff --git a/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGalleryImage.module.scss b/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGalleryImage.module.scss
index 4ad37ace7..9036a92e6 100644
--- a/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGalleryImage.module.scss
+++ b/packages/gatsby-theme-carbon/src/components/ImageGallery/ImageGalleryImage.module.scss
@@ -44,7 +44,8 @@
width: 100%;
}
-.image-in-dialog img {
+.image-in-dialog img,
+.image-in-dialog button {
margin: $spacing-05 0;
}
diff --git a/packages/gatsby-theme-carbon/src/components/MDXProvider/defaultComponents.js b/packages/gatsby-theme-carbon/src/components/MDXProvider/defaultComponents.js
index ca6bcb1ce..caf69d61c 100644
--- a/packages/gatsby-theme-carbon/src/components/MDXProvider/defaultComponents.js
+++ b/packages/gatsby-theme-carbon/src/components/MDXProvider/defaultComponents.js
@@ -23,6 +23,7 @@ import { AnchorLink, AnchorLinks } from '../AnchorLinks';
import { Tab, Tabs } from '../Tabs';
import Link from '../Link';
import { Accordion, AccordionItem } from '../Accordion';
+import GifPlayer from '../GifPlayer';
import ArtDirection from '../ArtDirection';
import MediumPosts from '../MediumPosts';
import Title from '../Title';
@@ -56,6 +57,7 @@ const components = {
DoDontRow,
Row,
Column,
+ GifPlayer,
Grid,
Caption,
ResourceCard,