Skip to content

Instantly share code, notes, and snippets.

@krambuhl
Created May 13, 2019 00:20
Show Gist options
  • Save krambuhl/b52f1b0da66ee287bd8e3d1b4b650f2d to your computer and use it in GitHub Desktop.
Save krambuhl/b52f1b0da66ee287bd8e3d1b4b650f2d to your computer and use it in GitHub Desktop.
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