Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (67 sloc) 1.76 KB
title
media

Type: string|array
Default: ['image', 'logo']
Values: 'image'|'logo'|'screenshot'|'video'

It determines the field to used as media of the card.

<MultiCodeEditor languages={{ React: `import Microlink from '@microlink/react'

export default () => ( <Microlink url='https://microlink.io' media={['image', 'logo']} /> ) , Vanilla:

<script> document.addEventListener('DOMContentLoaded', function (event) { microlink('a', { media: ['image', 'logo'] }) }) </script>

, Jekyll: {:.card-preview data-media='image,logo'} `}} />

The default value is a collection of field, meaning that the first valid value will be used as the image of the card.

However, you can pass a single value to be used instead, for example logo

<MultiCodeEditor languages={{ React: `import Microlink from '@microlink/react'

export default () => ( ) , Vanilla:

<script> document.addEventListener('DOMContentLoaded', function (event) { microlink('a', { media: 'logo' }) }) </script>

, Jekyll: {:.card-preview data-media='logo'} `}} />

The video detection is also supported

<MultiCodeEditor languages={{ React: `import Microlink from '@microlink/react'

export default () => ( ) , Vanilla:

<script> document.addEventListener('DOMContentLoaded', function (event) { microlink('a', { media: 'video' }) }) </script>

, Jekyll: {:.card-preview data-media='video'} `}} />

You can’t perform that action at this time.