UNPKG

@storybook/cli

Version:

Storybook's CLI - easiest method of adding storybook to your projects

27 lines (24 loc) 631 B
import './button.css'; import { createElement } from 'rax'; /** * Primary UI component for user interaction */ export const Button = ({ primary, backgroundColor, size, label, ...props }) => { const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; return ( <button type="button" className={['storybook-button', `storybook-button--${size}`, mode].join(' ')} style={backgroundColor && { backgroundColor }} {...props} > {label} </button> ); }; Button.defaultProps = { backgroundColor: null, primary: false, size: 'medium', onClick: undefined, };