Skip to content

Commit 933a608

Browse files
committed
chore: add default html attributes to button
1 parent c7eca10 commit 933a608

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/Button/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import * as S from './styles';
33

44
type ButtonSizesType = 'small' | 'regular' | 'large';
5+
56
type ButtonVariantsType =
67
| 'primary'
78
| 'secondary'
@@ -38,18 +39,19 @@ export type ButtonProps = {
3839
* Set the loading status of button
3940
*/
4041
loading?: boolean;
41-
};
42+
} & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className'>;
4243

4344
/**
4445
* API documentation for the React Button component. Learn about the available props, and the CSS API.
4546
*/
4647
export const Button = ({
4748
children,
4849
variant = 'primary',
49-
size = 'regular',
5050
isFullWidth = false,
51+
size = 'regular',
5152
disabled = false,
5253
onClick,
54+
...props
5355
}: ButtonProps) => {
5456
return (
5557
<S.Container
@@ -58,6 +60,7 @@ export const Button = ({
5860
isFullWidth={isFullWidth}
5961
disabled={disabled}
6062
onClick={onClick}
63+
{...props}
6164
>
6265
<span>{children}</span>
6366
</S.Container>

0 commit comments

Comments
 (0)