Image
<img> HTML. https://www.w3schools.com/csS/css3_object-fit.aspexport const Dimensions = () => {
return (
<Box>
<Box>
<Typography>Image originale avec 400 x 300</Typography>
<Image source="https://picsum.photos/seed/696/400/300" alt="Photo de démonstration" width={400} height={300} />
</Box>
<Box>
<Typography>Image déformée avec width 250 et height 200 (rendu 250 x 200)</Typography>
<Image source="https://picsum.photos/seed/696/400/300" alt="Photo de démonstration" width={250} height={200} />
</Box>
export const MaxWidth = () => {
return (
<Box>
<Typography>Image avec maxWidth de 200px (rendu 200 x 400)</Typography>
<Image source="https://picsum.photos/seed/696/400/300" alt="Photo de démonstration" maxWidth={200} />
</Box>
);
};
export const MaxHeight = () => {
return (
<Box>
<Typography>Image avec maxHeight de 200px (rendu 300 x 200)</Typography>
<Image source="https://picsum.photos/seed/696/400/300" alt="Photo de démonstration" maxHeight={200} />
</Box>
);
};
export const MaxWidthAndHeight = () => {
return (
<Box>
<Typography>Image avec maxWidth et maxHeight de 200px (rendu 200 x 200)</Typography>
<Image
source="https://picsum.photos/seed/696/400/300"
alt="Photo de démonstration"
maxWidth={200}
maxHeight={200}
/>
</Box>
);
export const contain = () => {
return (
<>
<Box>
<Typography>Image avec contentFit de contain (rendu 250 x 150)</Typography>
<Image
source="https://www.w3schools.com/csS/paris.jpg"
alt="Vue de Paris"
contentFit="contain"
width={250}
height={150}
/>
export const cover = () => {
return (
<Box>
<Typography>Image avec contentFit de cover (rendu 500 x 500)</Typography>
<Image
source="https://picsum.photos/seed/696/400/300"
alt="Photo de démonstration"
contentFit="cover"
width={500}
height={500}
/>
</Box>
export const fill = () => {
return (
<Box>
<Typography>Image avec contentFit de fill (rendu 500 x 500)</Typography>
<Image
source="https://picsum.photos/seed/696/400/300"
alt="Photo de démonstration"
contentFit="fill"
width={500}
height={500}
/>
</Box>
export const transition = () => {
return (
<Box>
<Typography>Image avec transition de 1000ms (rendu 200 x 200)</Typography>
<Image
source="https://picsum.photos/seed/696/400/300"
alt="Photo de démonstration"
transition={1000}
width={200}
height={200}
/>
</Box>
export const withAnotherImage = () => {
return (
<Box>
<Typography>Image avec contentFit de contain (rendu 200 x 150)</Typography>
<Image
source="https://www.w3schools.com/csS/paris.jpg"
alt="Vue de Paris"
contentFit="contain"
contentPosition="left"
width={200}
height={150}
/>
export const responsiveImage = () => {
return (
<Box>
<Typography>Image responsive. L'image doit prendre la taille de son conteneur. Ici 200 x 100</Typography>
<Box width={200} height={100}>
<Image
source="https://picsum.photos/seed/696/400/300"
alt="Photo de démonstration"
width={'100%'}
height={'100%'}
/>
</Box>
export const ImageNotFound = () => {
return (
<Box>
<Typography>Image non trouvée</Typography>
<Image source="https://invalid.url" alt="Image dont le chargement échoue" width={200} height={200} />
</Box>
);
};