office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
16 lines • 1.18 kB
JavaScript
define(["require", "exports", "react", "office-ui-fabric-react/lib/Button", "office-ui-fabric-react/lib/Panel", "@uifabric/react-hooks"], function (require, exports, React, Button_1, Panel_1, react_hooks_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PanelBasicExample = function () {
var _a = React.useState(false), isOpen = _a[0], setIsOpen = _a[1];
var openPanel = react_hooks_1.useConstCallback(function () { return setIsOpen(true); });
var dismissPanel = react_hooks_1.useConstCallback(function () { return setIsOpen(false); });
return (React.createElement("div", null,
React.createElement(Button_1.DefaultButton, { text: "Open panel", onClick: openPanel }),
React.createElement(Panel_1.Panel, { headerText: "Sample panel", isOpen: isOpen, onDismiss: dismissPanel,
// You MUST provide this prop! Otherwise screen readers will just say "button" with no label.
closeButtonAriaLabel: "Close" },
React.createElement("span", null, "Content goes here."))));
};
});
//# sourceMappingURL=Panel.Basic.Example.js.map