Sha256: d24ae6a91ab3f83dd96036a7776c471d8816ec1e67a33903f575f101b009da34
Contents?: true
Size: 726 Bytes
Versions: 63
Compression:
Stored size: 726 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 /> </button> </Popover> ); }; HelpLabel.propTypes = { id: PropTypes.string.isRequired, text: PropTypes.string, className: PropTypes.string, }; HelpLabel.defaultProps = { text: '', className: '', }; export default HelpLabel;
Version data entries
63 entries across 63 versions & 1 rubygems