import * as React from 'react'; import { Image, IImageProps } from '@fluentui/react/lib/Image'; // These props are defined up here so they can easily be applied to multiple Images. // Normally specifying them inline would be fine. const imageProps: Partial = { src: 'http://via.placeholder.com/350x150', // Show a border around the image (just for demonstration purposes) styles: props => ({ root: { border: '1px solid ' + props.theme.palette.neutralSecondary } }), }; export const ImageDefaultExample = () => (

With no imageFit property set, the width and height props control the size of the frame. Depending on which of those props is used, the image may scale to fit the frame.

Without a width or height specified, the frame remains at its natural size and the image will not be scaled.

Example with no image fit value and no height or width is specified.

If only a width is provided, the frame will be set to that width. The image will scale proportionally to fill the available width.

Example with no image fit value and only width is specified.

If only a height is provided, the frame will be set to that height. The image will scale proportionally to fill the available height.

Example with no image fit value and only height is specified.

If both width and height are provided, the frame will be set to that width and height. The image will scale to fill both the available width and height. This may result in a distorted image.

Example with no image fit value and height or width is specified.
);