office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
1 lines • 1.17 kB
JavaScript
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 ImageMaximizeFrameExample extends React.Component<any, any> {\r\n public render() {\r\n let imageProps: IImageProps = {\r\n src: 'http://placehold.it/500x500',\r\n imageFit: ImageFit.cover,\r\n maximizeFrame: true\r\n };\r\n\r\n return (\r\n <div>\r\n <p>Where the exact width and height of the image's frame is not known, such as when sizing an image as a percentage of its parent, you can use the \"maximizeFrame\" prop to expand the frame to fill the parent element.</p>\r\n <Label>The image is placed within a landscape container.</Label>\r\n <div style={ { width: '200px', height: '100px' } }>\r\n <Image { ...imageProps as any } />\r\n </div>\r\n <br />\r\n <Label>The image is placed within a portrait container.</Label>\r\n <div style={ { width: '100px', height: '200px' } }>\r\n <Image { ...imageProps as any } />\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"; });