Embed
Create responsive video or slideshow embeds based on the width of the parent by creating an intrinsic ratio that scales on any device.
Usage
Example
Script
return (
<CEmbed
ratio="16by9"
>
<iframe src="https://www.youtube.com/embed/ctV1-yIzZzU" />
</CEmbed>
)
# Features
- Simple wrapper for external source videos
- Optional aspect ratios
# Embed API
Name | Required | Type | Default Value |
---|---|---|---|
tag | any | div | |
main HTML tag name | |||
className | string | ||
user classes for the main HTML tag | |||
innerRef | (object | Function | string) | ||
ref to the main tag | |||
ratio | (21by9 | 16by9 | 4by3 | 1by1) | 16by9 | |
aspect ratio of embedded element, valid values: '21by9', '16by9', '4by3', '1by1' |
EmbedItem
# EmbedItem API
Name | Required | Type | Default Value |
---|---|---|---|
tag | any | iframe | |
main HTML tag name | |||
className | string | ||
user classes for the main HTML tag | |||
innerRef | (object | Function | string) | ||
ref to the main tag | |||
type | (iframe | embed | video | object | img) | ||
value for type attribute |