office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
29 lines • 1.61 kB
JavaScript
define(["require", "exports", "react", "office-ui-fabric-react/lib/ChoiceGroup", "@uifabric/example-data"], function (require, exports, React, ChoiceGroup_1, example_data_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChoiceGroupImageExample = function () {
var _a = React.useState('bar'), selectedKey = _a[0], setSelectedKey = _a[1];
var onChange = function (ev, option) {
setSelectedKey(option.key);
};
return (React.createElement("div", null,
React.createElement(ChoiceGroup_1.ChoiceGroup, { label: "Pick one image", selectedKey: selectedKey, options: [
{
key: 'bar',
imageSrc: example_data_1.TestImages.choiceGroupBarUnselected,
imageAlt: 'Bar chart icon',
selectedImageSrc: example_data_1.TestImages.choiceGroupBarSelected,
imageSize: { width: 32, height: 32 },
text: 'Clustered bar chart' // This text is long to show text wrapping.
},
{
key: 'pie',
imageSrc: example_data_1.TestImages.choiceGroupBarUnselected,
selectedImageSrc: example_data_1.TestImages.choiceGroupBarSelected,
imageSize: { width: 32, height: 32 },
text: 'Pie chart'
}
], onChange: onChange })));
};
});
//# sourceMappingURL=ChoiceGroup.Image.Example.js.map