office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
1 lines • 903 B
JavaScript
module.exports = "import * as React from 'react';\nimport {\n Image,\n IImageProps,\n ImageFit,\n Label\n} from '../../../../index';\n\nexport class ImageCoverExample extends React.Component<any, any> {\n public render() {\n let imageProps: IImageProps = {\n src: 'http://placehold.it/700x300',\n imageFit: ImageFit.cover\n };\n\n return (\n <div>\n <Label>The image has a wider aspect ratio (landscape) than the frame, so the image is scaled to fit the height and the sides are cropped evenly.</Label>\n <Image { ...imageProps as any } width={ 200 } height={ 200 } />\n <br />\n <Label>The image has a taller aspect ratio (portrait) than the frame, so the image is scaled to fit the width and the top and bottom are cropped evenly.</Label>\n <Image { ...imageProps as any } width={ 300 } height={ 50 } />\n </div>\n );\n }\n}\n";