mdc-react
Version:
Material Components for the web implemented in React
28 lines (21 loc) • 682 B
JSX
import { forwardRef } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { listGroupCssClasses as cssClasses } from './constants';
const ListGroupSubheader = forwardRef(({
title,
element: Element = 'h3',
className,
children = title,
...props
}, ref) => {
const classNames = classnames(cssClasses.SUBHEADER, className);
return (
<Element ref={ref} className={classNames} {...props}>{children}</Element>
);
});
ListGroupSubheader.displayName = 'MDCListGroupSubheader';
ListGroupSubheader.propTypes = {
title: PropTypes.string
};
export default ListGroupSubheader;