ant-design/components/input/Group.tsx

26 lines
640 B
TypeScript
Raw Normal View History

2016-09-21 11:54:53 +08:00
import React from 'react';
2016-03-31 17:46:35 +08:00
import classNames from 'classnames';
export interface GroupProps {
className?: string;
2016-08-22 17:26:14 +08:00
size?: 'large' | 'small' | 'default';
children?: any;
style?: React.CSSProperties;
prefixCls?: string;
}
2016-08-22 17:26:14 +08:00
const Group: React.StatelessComponent<GroupProps> = (props) => {
2016-10-24 12:04:26 +08:00
const { prefixCls = 'ant-input-group', className = '' } = props;
const cls = classNames(prefixCls, {
[`${prefixCls}-lg`]: props.size === 'large',
[`${prefixCls}-sm`]: props.size === 'small',
}, className);
return (
2016-10-24 12:04:26 +08:00
<span className={cls} style={props.style}>
{props.children}
</span>
);
2016-08-22 17:26:14 +08:00
};
2016-08-22 17:26:14 +08:00
export default Group;