Created
May 13, 2019 00:20
-
-
Save krambuhl/b52f1b0da66ee287bd8e3d1b4b650f2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import classnames from 'classnames' | |
import styles from './styles.css' | |
export default function Wrapper ({ | |
tagName: Tag = 'div', | |
variant = Wrapper.shell, | |
className, | |
children, | |
...attrs | |
}) { | |
const classList = classnames(styles.root, variant, className) | |
return ( | |
<Tag className={classList} {...attrs}>{children}</Tag> | |
) | |
} | |
// variants | |
Wrapper.shell = styles.sizeShell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment