Skip to content

Media

This component generates a media field to be used in the author dialog. The media field’s value is passed to the component as a prop.

PropertyTypeDescriptionDefault ValueRequired
labelstringThe label of the media componentYes
tooltipstringTooltip text for the media fieldNo
defaultValuestringDefault value for the media componentNo
allowedMimeTypesarrayArray of allowed MIME types for the media fieldNo
type MediaOutputType = {
alt: string;
url: string;
renditions: string[];
};

To use a media component in the author dialog, we can use the following code:

{
media: media({
label: 'Media',
tooltip: 'The media of the component',
allowedMimeTypes: ['image/jpeg', 'image/png', 'video/mp4'],
})
}

Media Component