Skip to Content
Hookboard
Components

Media components

Every media component a card can use, with its properties and an example.

Each component is an object with a type and the properties listed for it. Text and number properties may also hold a {{ }} template or a { "$bind": "…" } object; see Data, state and bindings. Every component also accepts the common properties.

image

An image from a URL, or a file sent with the card as {{files.name}}.

Does not take children.

PropertyTypeRequiredDefaultWhat it does
srcURLyesImage address.
alttextDescription for screen readers.
aspect"auto" "square" "video" "wide" "portrait""auto"Crop to a fixed shape.
fit"cover" "contain""cover"How the image fills its box.
rounded"none" "md" "full""md"Corner rounding.
zoombooleanOpen full size when tapped.
{
  "type": "image",
  "src": "https://picsum.photos/seed/hookboard/640/360",
  "alt": "Example",
  "aspect": "video"
}

avatar

A round picture with a text fallback.

Does not take children.

PropertyTypeRequiredDefaultWhat it does
srcURLPicture address.
nametextyesName; its initials show when there is no picture.
size"sm" "md" "lg""md"Size.
{
  "type": "avatar",
  "name": "Ada Lovelace"
}

video

A video player.

Does not take children.

PropertyTypeRequiredDefaultWhat it does
srcURLyesVideo address.
posterURLImage shown before playing.
{
  "type": "video",
  "src": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
}

audio

An audio player.

Does not take children.

PropertyTypeRequiredDefaultWhat it does
srcURLyesAudio address.
{
  "type": "audio",
  "src": "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3"
}

On this page