office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
30 lines • 2.61 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { Image } from 'office-ui-fabric-react/lib/Image';
import { Label } from 'office-ui-fabric-react/lib/Label';
var ImageDefaultExample = /** @class */ (function (_super) {
tslib_1.__extends(ImageDefaultExample, _super);
function ImageDefaultExample() {
return _super !== null && _super.apply(this, arguments) || this;
}
ImageDefaultExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement("p", null, "With no imageFit property set, the width and height props control the size of the frame. Depending on which of those props is used, the image may scale to fit the frame."),
React.createElement(Label, null, "Without a width or height specified, the frame remains at its natural size and the image will not be scaled."),
React.createElement(Image, { src: "http://placehold.it/350x150", alt: "Example implementation with no image fit property and no height or width is specified." }),
React.createElement("br", null),
React.createElement(Label, null, "If only a width is provided, the frame will be set to that width. The image will scale proportionally to fill the available width."),
React.createElement(Image, { src: "http://placehold.it/350x150", alt: "Example implementation with no image fit property and only width is specified.", width: 600 }),
React.createElement("br", null),
React.createElement(Label, null, "If only a height is provided, the frame will be set to that height. The image will scale proportionally to fill the available height."),
React.createElement(Image, { src: "http://placehold.it/350x150", alt: "Example implementation with no image fit property and only height is specified.", height: 100 }),
React.createElement("br", null),
React.createElement(Label, null,
"If both width and height are provided, the frame will be set to that width and height. The image will scale to fill both the available width and height. ",
React.createElement("strong", null, "This may result in a distorted image.")),
React.createElement(Image, { src: "http://placehold.it/350x150", alt: "Example implementation with no image fit property and height or width is specified.", width: 100, height: 100 })));
};
return ImageDefaultExample;
}(React.Component));
export { ImageDefaultExample };
//# sourceMappingURL=Image.Default.Example.js.map