UNPKG

737 BJavaScriptView Raw
1import React from 'react';
2import PropTypes from 'prop-types';
3import classNames from 'classnames';
4import { mapToCssModules, tagPropType } from './utils';
5
6const propTypes = {
7 /** Add custom class */
8 className: PropTypes.string,
9 /** Change underlying component's CSS base class name */
10 cssModule: PropTypes.object,
11 /** Set a custom element for this component */
12 tag: tagPropType,
13};
14
15function InputGroupText(props) {
16 const { className, cssModule, tag: Tag = 'span', ...attributes } = props;
17
18 const classes = mapToCssModules(
19 classNames(className, 'input-group-text'),
20 cssModule,
21 );
22
23 return <Tag {...attributes} className={classes} />;
24}
25
26InputGroupText.propTypes = propTypes;
27
28export default InputGroupText;
29
\No newline at end of file