office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
1 lines • 986 B
JavaScript
module.exports = "import * as React from 'react';\nimport {\n Image,\n IImageProps,\n ImageFit,\n Label\n} from '../../../../index';\n\nexport class ImageCenterExample extends React.Component<any, any> {\n public render() {\n let imageProps: IImageProps = {\n src: 'http://placehold.it/800x300',\n imageFit: ImageFit.center,\n width: 350,\n height: 150,\n onLoad: (ev) => console.log('image loaded', ev)\n };\n\n return (\n <div>\n <Label>The image is larger than the frame and its size is maintained, so all sides are cropped to center the image.</Label>\n <Image { ...imageProps as any } src='http://placehold.it/800x300' />\n <br />\n <Label>The image is smaller than the frame and its size is maintained, so there is empty space within the frame. The image is centered in the empty space.</Label>\n <Image { ...imageProps as any } src='http://placehold.it/100x100' />\n </div>\n );\n }\n}\n";