diff --git a/src/Tooltip.js b/src/Tooltip.js
index 1c7dafeb80..e98001187b 100644
--- a/src/Tooltip.js
+++ b/src/Tooltip.js
@@ -1,21 +1,33 @@
+/* eslint-disable react/no-multi-comp */
import React from 'react';
import classNames from 'classnames';
import BootstrapMixin from './BootstrapMixin';
import FadeMixin from './FadeMixin';
+import CustomPropTypes from './utils/CustomPropTypes';
const Tooltip = React.createClass({
mixins: [BootstrapMixin, FadeMixin],
propTypes: {
+ /**
+ * An html id attribute, necessary for accessibility
+ * @type {string}
+ * @required
+ */
+ id: CustomPropTypes.isRequiredForA11y(React.PropTypes.string),
+
placement: React.PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
positionLeft: React.PropTypes.number,
positionTop: React.PropTypes.number,
+
arrowOffsetLeft: React.PropTypes.oneOfType([
React.PropTypes.number, React.PropTypes.string
]),
+
arrowOffsetTop: React.PropTypes.oneOfType([
React.PropTypes.number, React.PropTypes.string
]),
+
animation: React.PropTypes.bool
},
@@ -46,7 +58,7 @@ const Tooltip = React.createClass({
};
return (
-
+
{this.props.children}
diff --git a/src/index.js b/src/index.js
index 437008dabb..a16f1649c1 100644
--- a/src/index.js
+++ b/src/index.js
@@ -53,8 +53,8 @@ import Tooltip from './Tooltip';
import utils from './utils';
import Well from './Well';
import styleMaps from './styleMaps';
-
import Portal from './Portal';
+import Position from './Position';
export default {
Accordion,
@@ -101,6 +101,7 @@ export default {
Pagination,
Popover,
Portal,
+ Position,
ProgressBar,
Row,
SplitButton,
diff --git a/src/utils/CustomPropTypes.js b/src/utils/CustomPropTypes.js
index 53c96e29c1..cb57a653cb 100644
--- a/src/utils/CustomPropTypes.js
+++ b/src/utils/CustomPropTypes.js
@@ -3,6 +3,20 @@ import React from 'react';
const ANONYMOUS = '<
>';
const CustomPropTypes = {
+
+ isRequiredForA11y(propType){
+ return function(props, propName, componentName){
+ if (props[propName] === null) {
+ return new Error(
+ 'The prop `' + propName + '` is required to make ' + componentName + ' accessible ' +
+ 'for users using assistive technologies such as screen readers `'
+ );
+ }
+
+ return propType(props, propName, componentName);
+ };
+ },
+
/**
* Checks whether a prop provides a DOM element
*