react-bootstrap
Version:
Bootstrap 3 components build with React
36 lines (29 loc) • 770 B
JavaScript
import React from 'react';
import classNames from 'classnames';
import BootstrapMixin from './BootstrapMixin';
const ButtonGroup = React.createClass({
mixins: [BootstrapMixin],
propTypes: {
vertical: React.PropTypes.bool,
justified: React.PropTypes.bool
},
getDefaultProps() {
return {
bsClass: 'button-group'
};
},
render() {
let classes = this.getBsClassSet();
classes['btn-group'] = !this.props.vertical;
classes['btn-group-vertical'] = this.props.vertical;
classes['btn-group-justified'] = this.props.justified;
return (
<div
{...this.props}
className={classNames(this.props.className, classes)}>
{this.props.children}
</div>
);
}
});
export default ButtonGroup;