Sha256: eb1303b2997a3aabb7226855ed74afb5b5c7e7cceffc928d378d541b017ff319
Contents?: true
Size: 742 Bytes
Versions: 26
Compression:
Stored size: 742 Bytes
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { Popover } from '@patternfly/react-core'; import { HelpIcon } from '@patternfly/react-icons'; export const HelpLabel = ({ text, id, className }) => { if (!text) return null; return ( <Popover id={`${id}-help`} bodyContent={text} aria-label="help-text"> <button onClick={e => e.preventDefault()} className={`pf-c-form__group-label-help ${className}`} > <HelpIcon noVerticalAlign /> </button> </Popover> ); }; HelpLabel.propTypes = { id: PropTypes.string.isRequired, text: PropTypes.string, className: PropTypes.string, }; HelpLabel.defaultProps = { text: '', className: '', }; export default HelpLabel;
Version data entries
26 entries across 26 versions & 1 rubygems