Skip to content

Instantly share code, notes, and snippets.

@martinusso
Created September 18, 2023 19:03
Show Gist options
  • Save martinusso/e7bccf9e0dd90a21b3bd01c85a2774be to your computer and use it in GitHub Desktop.
Save martinusso/e7bccf9e0dd90a21b3bd01c85a2774be to your computer and use it in GitHub Desktop.
react components
import React from 'react';
import { Box } from '@mui/material';
type ImgProps = {
alt?: string;
src: string;
width: number;
height?: number;
};
export function Img({ alt, src, height, width }: ImgProps): React.JSX.Element {
return <Box component="img" alt={alt} src={src} sx={{ height, width }} />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment