UNPKG

@momentum-ui/react

Version:

Cisco Momentum UI framework for ReactJs applications

38 lines (28 loc) 701 B
/** @component close-icon */ import React from 'react'; import PropTypes from 'prop-types'; const CloseIcon = props => { const { className, onClick, ...otherHTMLProps } = props; return ( <button className={ `md-close` + `${(className && ` ${className}`) || ''}` } onClick={onClick} {...otherHTMLProps} /> ); }; CloseIcon.defaultProps = { onClick: () => {}, className: '', }; CloseIcon.propTypes = { /** @prop Handler when the user clicks the CloseIcon | () => {} */ onClick: PropTypes.func, /** @prop Optional css class string | '' */ className: PropTypes.string, }; CloseIcon.displayName = 'CloseIcon'; export default CloseIcon;