Create a Link Previewer component in React that takes in children prop, that, when hovered over, displays the link that was provided to the component as a URL prop. This preview component will be an overlay component that displays the website based on their URLs.
Note: Read the documentation for Microlink to understand how to take a screenshot of any website.
url
to the <LinkPreviewer>
component, A popover / modal should appear on top of the link that will show the screenshot of that website.dynamic
and not any hardcoded image
.Hover
and disappear on mouse leave.<LinkPreview url="https://manuarora.in">
Hover over me to Preview
</LinkPreview>
framer-motion
library to animate entry and exit of the component.Click to reveal
Try reading the Microlink documentation and see how to make an API call. To ease things out, here's an example of taking a screenshot of my personal website
https://api.microlink.io?url=https%3A%2F%2Fmanuarora.in&screenshot=true&meta=false&embed=screenshot.url"
This can directly be put under the src
tag of img
and served as a static image.
Click to reveal
Try using onMouseEnter()
and onMouseLeave()
events on the a
tag to show and hide component.