Media
import * as React from "react";
import { Image } from "spaceweb/image";
export default () => {
return (
<Image
height={200}
width={200}
src="https://s3.amazonaws.com/cdn-origin-etr.akc.org/wp-content/uploads/2018/01/12201051/cute-puppy-body-image.jpg"
alt="Cute doggo"
/>
);
}
Media renders content like image & video.
Examples
Images with different fit properties
containfill
Default fallback component
Custom fallback component and error handler
Override default fallback props
You can check the implementation of the component for more details.
Image exports
You can import this module like so:
import {Image} from 'spaceweb/image'
It exports the following components or utility functions: