This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/packages/dashboard-v2/src/components/Button/Button.js

42 lines
837 B
JavaScript
Raw Normal View History

2022-02-18 08:20:47 +00:00
import PropTypes from "prop-types";
/**
* Primary UI component for user interaction
*/
export const Button = ({ primary, label, ...props }) => {
return (
<button
type="button"
className={`min-w-button min-h-button rounded-full font-sans uppercase tracking-wide text-button
2022-02-18 08:20:47 +00:00
${primary ? "bg-primary" : "bg-white border-2 border-black"}`}
{...props}
>
{label}
</button>
2022-02-18 08:20:47 +00:00
);
};
Button.propTypes = {
/**
* Is this the principal call to action on the page?
*/
primary: PropTypes.bool,
/**
* What background color to use
*/
backgroundColor: PropTypes.string,
/**
* Button contents
*/
label: PropTypes.string.isRequired,
/**
* Optional click handler
*/
onClick: PropTypes.func,
2022-02-18 08:20:47 +00:00
};
Button.defaultProps = {
primary: false,
onClick: undefined,
2022-02-18 08:20:47 +00:00
};