office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
28 lines • 1.88 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { Image, ImageFit } from 'office-ui-fabric-react/lib/Image';
import { Label } from 'office-ui-fabric-react/lib/Label';
var ImageNoneExample = /** @class */ (function (_super) {
tslib_1.__extends(ImageNoneExample, _super);
function ImageNoneExample() {
return _super !== null && _super.apply(this, arguments) || this;
}
ImageNoneExample.prototype.render = function () {
var imageProps = {
src: 'http://placehold.it/500x250',
imageFit: ImageFit.none,
width: 350,
height: 150
};
return (React.createElement("div", null,
React.createElement("p", null, "By setting the imageFit property to \"none\", the image will remain at its natural size, even if the frame is made larger or smaller by setting the width and height props."),
React.createElement(Label, null, "The image is larger than the frame, so it is cropped to fit. The image is positioned at the upper left of the frame."),
React.createElement(Image, tslib_1.__assign({}, imageProps, { alt: "Example implementation of the property image fit using the none value on an image larger than the frame." })),
React.createElement("br", null),
React.createElement(Label, null, "The image is smaller than the frame, so there is empty space within the frame. The image is positioned at the upper left of the frame."),
React.createElement(Image, tslib_1.__assign({}, imageProps, { src: "http://placehold.it/100x100", alt: "Example implementation of the property image fit using the none value on an image smaller than the frame." }))));
};
return ImageNoneExample;
}(React.Component));
export { ImageNoneExample };
//# sourceMappingURL=Image.None.Example.js.map