forked from rstackjs/rstack-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.tsx
More file actions
46 lines (44 loc) · 843 Bytes
/
Copy pathButton.tsx
File metadata and controls
46 lines (44 loc) · 843 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
44
45
46
import './button.css';
export interface ButtonProps {
/**
* Whether the button is primary
* @default false
*/
primary?: boolean;
/**
* Background color of the button
*/
backgroundColor?: string;
/**
* Size of Button
* @default 'medium'
*/
size?: 'small' | 'medium' | 'large';
/**
* Label of the button
*/
label: string;
/**
* Optional click handler
*/
onClick?: () => void;
}
export const Button = ({
primary = false,
size = 'medium',
backgroundColor,
label,
...props
}: ButtonProps) => {
const mode = primary ? 'demo-button--primary' : 'demo-button--secondary';
return (
<button
type="button"
className={['demo-button', `demo-button--${size}`, mode].join(' ')}
style={{ backgroundColor }}
{...props}
>
{label}
</button>
);
};