Unstack Dev Docs
Search…
Media
The Media Tag enables your content authors to add media to pages, augmented with full editor controls for linking, resizing, and media library management, and can be programmed to constrain the media output to specific dimensions, quality, etc.
1
<Media dataRef={content.media} .../>
Copied!

Media Tag Props:

  • dataRef: DataLocator - the data-element storing the Media's configuration
  • className: string (optional) - a hard-coded class name to add to the rendered element
  • category: string (optional) - a string ("image" or "icon") indicating the category in which to store the attached media. Note: "video" and "pdf" media will be segregated by their mime types.
  • aspectRatio: number (optional) - an expression indicating the desired proportions of the resized media on output, e.g. "1x1", "4x3" or "16x9". (Default: none)
  • crop: string (optional) -an expression indicating the desired cropping of the resized media on output, e.g. "topleft", "topcenter', or "middlecenter" (Default: none)
  • quality: number (optional) - a number from 1-100 indicating the compression quality of the media for output formats that support it (default 80)
  • enableResizing: boolean (optional) - when True, allows the media to be resized using a bounding box UI (Default: False)
  • enableLinking: boolean (optional) - when True, allows the media to be embedded in a link using the Smart URL input UI (Default: True)
  • enableVideos: boolean (optional) - when True, allows video media to be uploaded into this area (Default: False)
Copy link