UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

1 lines 1.06 kB
define([], function() { return "import * as React from 'react';\r\nimport {\r\n Image,\r\n IImageProps,\r\n ImageFit,\r\n Label\r\n} from '../../../../index';\r\n\r\nexport class ImageCenterExample extends React.Component<any, any> {\r\n public render() {\r\n let imageProps: IImageProps = {\r\n src: 'http://placehold.it/800x300',\r\n imageFit: ImageFit.center,\r\n width: 350,\r\n height: 150,\r\n onLoad: (ev) => console.log('image loaded', ev)\r\n };\r\n\r\n return (\r\n <div>\r\n <Label>The image is larger than the frame and its size is maintained, so all sides are cropped to center the image.</Label>\r\n <Image { ...imageProps as any } src='http://placehold.it/800x300' />\r\n <br />\r\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>\r\n <Image { ...imageProps as any } src='http://placehold.it/100x100' />\r\n </div>\r\n );\r\n }\r\n}\r\n"; });