Vimeo Embed
Lightweight Vimeo videos using a fork of lite-vimeo-embed. Supports using a custom preview image and title.
How to use
<Section columns={1}>
<Markdown>
# Vimeo Embed
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
</Markdown>
import Vimeo from "~/components/media/videos/Vimeo.astro";
import PreviewImage from "~/assets/jpg/arthur-mazi-6148mnVnY-s-unsplash.jpg";
<Vimeo
url="https://vimeo.com/170585872"
title="Example title to display"
image={{
src: PreviewImage,
alt: "Example alt text here",
}}
/>
</Section>Props
| Prop | Type | Description |
|---|---|---|
image | object | (optional) Image data for the component. See fields below. |
label | string | (optional) Custom screen reader text for the play button, default is “Play video” |
params | string | (optional) URL params to customise player. See supported params here |
title | string | (optional) The title displayed at the top of the video. |
url | string | Can be either a Vimeo video ID or the URL e.g. https://vimeo.com/170585872 |
class | string | (optional) Additional classes applied to the root <div>. |
| (extends) | HTMLAttributes<"div"> | (optional) All standard HTML attributes for a <div>. |
image object
src— ImageMetadata
The imported image metadata (output from Astro’s image import).alt— string
(optional) Alt text for the image, defaults to empty string"".
More examples
About MDX
astro-skeleton uses the @astrojs/mdx integration installed and configured in the astro.config.mjs config file.
Why MDX?
MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to mix JavaScript and UI Components into Markdown content for things like interactive charts or alerts.
If you have existing content authored in MDX, this integration will hopefully make migrating a breeze.