office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
23 lines • 1.33 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
import { TooltipHost } from 'office-ui-fabric-react/lib/Tooltip';
import { getId } from 'office-ui-fabric-react/lib/Utilities';
var TooltipInteractiveExample = /** @class */ (function (_super) {
tslib_1.__extends(TooltipInteractiveExample, _super);
function TooltipInteractiveExample() {
var _this = _super !== null && _super.apply(this, arguments) || this;
// Use getId() to ensure that the ID is unique on the page.
// (It's also okay to use a plain string without getId() and manually ensure uniqueness.)
_this._hostId = getId('tooltipHost');
return _this;
}
TooltipInteractiveExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement(TooltipHost, { content: "This is the tooltip", id: this._hostId, calloutProps: { gapSpace: 0 }, closeDelay: 500, styles: { root: { display: 'inline-block' } } },
React.createElement(DefaultButton, { "aria-describedby": this._hostId }, "Interact with my tooltip"))));
};
return TooltipInteractiveExample;
}(React.Component));
export { TooltipInteractiveExample };
//# sourceMappingURL=Tooltip.Interactive.Example.js.map