<div id="" class="MoreInfo " style="" tabindex="0" data-content="?" aria-label="More Info">
<div id="" class="Tooltip " style="">
<h3 class=" " style="">
Tooltip Title
</h3>
<p id="" class="">
Tooltip body copy.
</p>
</div>
</div>
<div
id="{{id}}"
class="MoreInfo {{modifier}}"
style="{{style}}"
tabindex="0"
data-content="{{content}}"
aria-label="{{label}}"
>
{{> @children}}
</div>
{
"id": null,
"modifier": null,
"style": null,
"content": "?",
"label": "More Info",
"children": [
{
"component": "tooltip"
}
]
}
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
const render = require('../../../helpers/render').render;
const MoreInfo = (props) => {
return(
<div
id={props.id}
className={cx(['MoreInfo', props.modifier])}
tabIndex="0"
aria-label={props.label}
>
{render(props.children)}
</div>
);
};
MoreInfo.propTypes = {
id: PropTypes.string,
modifier: PropTypes.string,
label: PropTypes.string,
};
export default MoreInfo;
.MoreInfo {
@include circle-background($background: get-color(neutral, 400), $font-size: $font-size-fine, $size: $font-size-fine * 1.3);
position: relative;
display: inline-block;
margin-left: Space(300);
text-align: left;
vertical-align: text-bottom;
&::before {
position: relative;
top: .15em;
display: inline-block;
width: 100%;
text-align: center;
content: attr(data-content) " ";
}
}
A MoreInfo component is used to indicate that there is additional information not currently visible to the user. Typically, it will contain a Tooltip as a child, which will become visible when the MoreInfo container is hovered or focused.
For screenreaders, the default label for a MoreInfo component is “More Info.” This can be
overridden by the label
prop.