defineOgImageScreenshot()
Define an OG Image that takes a screenshot of the page.
Introduction
The
This requires the
Props
colorScheme
- Type:
'dark' | 'light' - Default:
'light'
The color scheme to use when generating the image. This is useful for generating dark mode images.
defineOgImageScreenshot({
colorScheme: 'dark'
})
delay
- Type:
number - Default:
0
The delay to wait before taking the screenshot. This is useful if you want to wait for animations to complete.
defineOgImageScreenshot({
// wait 2 seconds
delay: 2000
})
mask
- Type:
string - Default:
undefined
HTML selectors that should be removed from the image. Useful for removing popup banners or other elements that may be in the way.
defineOgImageScreenshot({
mask: '.popup-banner, .cookie-banner'
})
selector
- Type:
string - Default:
undefined
The selector to take a screenshot of. This is useful if you want to exclude header / footer elements.
defineOgImageScreenshot({
selector: '.page-content'
})
Did this page help you?