diff --git a/components/content/examples/aspectratio/AspectRatioEImage.vue b/components/content/examples/aspectratio/AspectRatioEImage.vue new file mode 100644 index 0000000..029c3f5 --- /dev/null +++ b/components/content/examples/aspectratio/AspectRatioEImage.vue @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/components/content/examples/aspectratio/AspectRatioEMap.vue b/components/content/examples/aspectratio/AspectRatioEMap.vue new file mode 100644 index 0000000..8a55f11 --- /dev/null +++ b/components/content/examples/aspectratio/AspectRatioEMap.vue @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/components/content/examples/aspectratio/AspectRatioEVideo.vue b/components/content/examples/aspectratio/AspectRatioEVideo.vue new file mode 100644 index 0000000..aae5e0d --- /dev/null +++ b/components/content/examples/aspectratio/AspectRatioEVideo.vue @@ -0,0 +1,7 @@ + diff --git a/content/4.components/aspectratio.md b/content/4.components/aspectratio.md new file mode 100644 index 0000000..77f4968 --- /dev/null +++ b/content/4.components/aspectratio.md @@ -0,0 +1,58 @@ +--- +title: Aspect Ratio +description: Aspect ratio component +version: 2.0+ +--- + +# Aspect Ratio + +`CAspectRatio` component is used to embed responsive videos and maps, etc. + +## Import + +```js +import { CAspectRatio } from '@chakra-ui/vue-next'; +``` + +## Usage + +### Embed Video + +To embed a video with a specific aspect ratio, use a `CBox` as an `iframe` with src pointing to the link of the video. + +Pass the `max-width` prop to `CAspectRatio` to control the width of the content. + +::showcase +::aspect-ratio-e-video{width=full} +:: +:: + +```html + + + +``` + +### Embed Image + + You can also embed image that has a 4:3 aspect ratio. + + ::showcase +::aspect-ratio-e-image{width=full} +:: +:: + +```html + + + +``` + +### Embed a responsive map + +Here's how to embed a responsive Google map using `CAspectRatio`. To make the map take up the entire width, we can ignore the max-width prop. + +::showcase +::aspect-ratio-e-map{width=full} +:: +::