Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

button-group

v1.10.0arrow_drop_down
v1.10.0
v1.9.0
v1.7.0
v1.6.1
v1.4.0
STATUS
Passing
DOWNLOADS
190
VISIBILITY
Public
PUBLISHED
10 months ago
SIZE
18 KB
Button groups are used to bunch together buttons with similar actions
1 contributor
Install button-group as a package?
Copied
npm i @bit/nexxtway.react-rainbow.button-group
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Files
ButtonGroup/index.js
32 Lines(21 sloc)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react';
import PropTypes from 'prop-types';
import StyledContainer from './styled/container';

/**
 * Button groups are used to bunch together buttons with similar actions
 */
export default function ButtonGroup(props) {
    const { className, style, children } = props;

    return (
        <StyledContainer className={className} style={style} role="group">
            {children}
        </StyledContainer>
    );
}

ButtonGroup.propTypes = {
    /** The content of the ButtonGroup.
     * Accepted childrens include Button, ButtonIcon and ButtonMenu. */
    children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.object]),
    /** A CSS class for the outer element, in addition to the component's base classes. */
    className: PropTypes.string,
    /** An object with custom style applied to the outer element. */
    style: PropTypes.object,
};

ButtonGroup.defaultProps = {
    children: null,
    className: undefined,
    style: undefined,
};