Blocks

Video

A YouTube or Vimeo video: its player on a page; in an email (which can't play one), its thumbnail, linked to it.

import { Video } from "@hyper-elements/react";

Example

Show the code
video.tsx
import { Column, Page, Video } from "@hyper-elements/react";

export default function Example() {
  return (
    <Page width={520} style={{ backgroundColor: "#ffffff", fontFamily: "Inter, Helvetica, Arial, sans-serif", color: "#0f172a", gap: 16 }}>
      <Column style={{ padding: 24, gap: 16 }}>
        <Video
          src="https://www.youtube.com/watch?v=eCHaiEjCDFM"
          title="Watch the keynote"
        />
      </Column>
    </Page>
  );
}

Reference

A YouTube or Vimeo video: its player on a page; in an email (which can’t play one), its thumbnail, linked to it.

Holds: nothing. Drawn in: email, page.

Props:

  • src: video (required). The video’s YouTube or Vimeo link.
  • thumbnail: asset. The image an email shows, linked to the video. A YouTube video’s own where there’s none; a Vimeo video’s can’t be found without the network.
  • title: text (default "Video"). The player’s title on a page, the thumbnail’s alternate text in an email.

style:

  • width: a length (a number of px, %)
  • maxWidth: a length (a number of px, %)
  • flex: flex. In a Row: its share of the width left after children with a width (default 1); “none” takes its own size.

mobile (on phones): width, maxWidth.