ant-design/components/button/button-group.jsx

28 lines
560 B
React
Raw Normal View History

2015-09-27 16:30:35 +08:00
import React from 'react';
import classNames from 'classnames';
2015-09-27 16:30:35 +08:00
const prefix = 'ant-btn-group-';
export default function ButtonGroup(props) {
const { size, className, ...others } = props;
// large => lg
// small => sm
const sizeCls = ({
large: 'lg',
small: 'sm',
})[size] || '';
const classes = classNames({
'ant-btn-group': true,
[prefix + sizeCls]: sizeCls,
2016-05-11 09:32:33 +08:00
[className]: className,
});
return <div {...others} className={classes} />;
2015-09-27 16:30:35 +08:00
}
ButtonGroup.propTypes = {
size: React.PropTypes.oneOf(['large', 'small']),
};