---
title: Examples
slug: wip/vvDD-examples
createdAt: 2023-07-20T14:45:03.180Z
---

# Examples

## Basic Usage

The Video Card only needs a few data points to render a fully functional card.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/04c0b4cc1318395e2766dfb786e364b0?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;530px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices:**

- The headline and text should use [sentence-case](https://en.wikipedia.org/wiki/Letter_case#Sentence_case)
- Headlines shouldn't hold more than 75 characters, and a maximum of 40 when displaying Asian characters
- Images should always be paired with an alternative text to support assistive technologies

## Extended Usage

Optionally, the Video Card can be extended with additional information

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/01c013d3d0081093e7e9bd2db97e07dc?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;530px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices:**

- The tag should use [title-case](https://en.wikipedia.org/wiki/Letter_case#Title_case)
- The tag is used to categorize cards, for example by discipline
- The badge is only used for promoting selected cards
- The duration is rounded to full minutes using a minimum of one minute

## Live Badge

Video Cards can be indicated whether their video is premiering live.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/47ef4359dd43c6637b61d26eb96f09ff?default-tab=html%2Cresult&#x26;amp;theme-id=39623&#x26;amp;editable=true&#x22; height=&#x22;496px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Preview Video

A great way to turn the Video Card into an engaging teaser is to add a video that appears on hover gesture

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/82e5536ff9b85a7ff906bf72460375a2?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;519px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices**

- The duration of the video should be limited to 5 seconds

## Preview Image

To improve the user experience and performance of Video Cards use preview images while waiting for the high-resolution image to be loaded.

*Note: The example below demonstrates the rendering of the preview image only. In a production environment, a high-resolution* `_image_` *would be set alongside*

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/5067aa8095adbfae359700dc064b78da?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;531px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best practices:**

- Preview images should be a scaled version of the featured image with a maximum of 50px width
- To ensure meaningful content to be shown as fast as possible without any additional network requests preview images should be provided as base64 encoded data URIs

## Responsive Image and Performance

A great way to balance client-side performance and responsive images is by using `srcset` in conjunction with `sizes` and `loading` attributes. Read more about responsive image best practices here: [Image](https://cosmos.redbull.design/wip/image)

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/MWzGxOX/0a81bc21910b2e6a2cd135abd4748eb2?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;538px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Logo

Instead of a tag, Video Cards can display a logo.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/b0aad463fba7f87b68df982dbbed6c33?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;526px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best practices:**

- The logo is only used for brands or projects, not for sponsors
- Logos should be SVG or PNG images with a transparent background
- Logos with a width/height ratio lower than 1.5 should have `logo-narrow` enabled to optimized the appearance on the card

## Make it favoritable

Video Cards can be favorited by users – while the favorite button will be persistently displayed on touch-based devices, the button will only show up on hover on devices with pointer-based inputs.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/6a878caab1b9284a00782d42547478f8?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;513px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best practices:**

- The state of whether the Video has been favorited or not has to be managed outside the component
- The `favorite-aria-label` should reflect the action that will be performed based on the current "favorite" state
- Clicking on the favorite button won't propagate the `click` event to the card component and won't go in the way of catching link redirection.

## Compact Layout

Video Cards support a compact layout for use cases where it doesn't have enough space available.

:::hint{type="info"}
💡 **Pro Tip**

The Video Card's layout is a [Responsive Properties](https://cosmos.redbull.design/wip/responsive-properties) and can be configured per breakpoint. Try out [this example](https://codepen.io/redbulldesign/live/d504859d65e8aec398659cb431b593c2)
:::

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/aa6913299ad8ca9f05cfb4946f2cf8dc?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;423px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices:**

- The Video Card should use a compact layout whenever the available width is smaller than 290px

## Listen to Resize Events

When initially mounting and whenever the media container of the Video Card resizes, the card emits a `mediaresize` event including the media's width and height.

A common use-case is to update the image to make it perfectly fit the available space.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/1f6df39d0a8c4e600530e2367651b0d5?default-tab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;529px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices:**

- Only enable the `observe-media-resize` when needed

