Skip to content

Instantly share code, notes, and snippets.

@grantglidewell
Created July 31, 2018 22:08
Show Gist options
  • Save grantglidewell/8f375fd1636847bcf2880a6625c32dd5 to your computer and use it in GitHub Desktop.
Save grantglidewell/8f375fd1636847bcf2880a6625c32dd5 to your computer and use it in GitHub Desktop.
Zesty.io Button Group
export function ButtonGroup(props) {
let opts = {
className: cx(styles.ButtonGroup, props.className)
};
return (
<div {...opts}>
{React.Children.map(props.children, child => {
if (child) {
return React.cloneElement(child, {
className: cx(styles.child, child.props.className)
});
}
})}
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment