Slide 25
Slide 25 text
/**
* A standard, branded clickable element for use in forms mainly.
* @version 1.0.2
*/
class Button extends React.Component {
render() {
// ...
}
}
Button.propTypes = {
/**
* The HTML button type.
* @see See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/
Element/button) for more info.
*/
type: PropTypes.oneOf(['button', 'submit', 'reset']),
/**
* The style.
*/
variant: PropTypes.oneOf(['primary', 'secondary', 'inverted']),
/**
* The label.
*/
children: PropTypes.string.isRequired,
}
Button.defaultProps = {
type: 'button',
variant: 'primary',
}