react-material-web-components
Version:
React Wrapper for Material Design Components
35 lines (29 loc) • 705 B
JavaScript
import React, {PureComponent} from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
class GridTileTitle extends PureComponent {
static displayName = 'GridTileTitle'
static propTypes = {
children: PropTypes.node,
className: PropTypes.string,
tagName: PropTypes.string,
}
static defaultProps = {
tagName: 'span',
}
render() {
const {
children,
className,
tagName,
...otherProps,
} = this.props
const cssClasses = classNames('mdc-grid-tile__title', className)
return React.createElement(
tagName,
{...otherProps, className: cssClasses},
children
)
}
}
export default GridTileTitle