-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathButton.js
More file actions
43 lines (39 loc) · 823 Bytes
/
Button.js
File metadata and controls
43 lines (39 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/** @jsx jsx */
import { any } from 'prop-types'
import { jsx } from 'theme-ui'
function Button({ as: Component, ...props }) {
return (
<Component
sx={{
display: 'inline-block',
margin: 0,
paddingY: 3,
paddingX: 5,
fontSize: 2,
fontWeight: 'bold',
fontFamily: 'inherit',
lineHeight: 'inherit',
textAlign: 'center',
textDecoration: 'none',
color: 'white',
backgroundColor: 'primary',
border: 0,
borderRadius: 1,
appearance: 'none',
cursor: 'pointer',
'&:disabled': {
opacity: 0.5,
pointerEvents: 'none',
},
}}
{...props}
/>
)
}
Button.propTypes = {
as: any,
}
Button.defaultProps = {
as: 'button',
}
export default Button