aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/buttons/button.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-06 19:17:15 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-06 19:17:15 +0200
commit51889773b12c576dc199fc84d0188f822ac7baae (patch)
treed79897d463f2517573f6dfce2d1bd27ca476eb28 /src/components/atoms/buttons/button.tsx
parent47e12259d512e476326e83929efebf036b57f7c1 (diff)
chore: add a HelpButton component
I also added a new shape to the button base.
Diffstat (limited to 'src/components/atoms/buttons/button.tsx')
-rw-r--r--src/components/atoms/buttons/button.tsx13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/components/atoms/buttons/button.tsx b/src/components/atoms/buttons/button.tsx
index 08b8d67..ae4c894 100644
--- a/src/components/atoms/buttons/button.tsx
+++ b/src/components/atoms/buttons/button.tsx
@@ -3,9 +3,13 @@ import styles from './buttons.module.scss';
export type ButtonProps = {
/**
+ * Add additional classes to the button wrapper.
+ */
+ additionalClasses?: string;
+ /**
* Button accessible label.
*/
- 'aria-label'?: string;
+ ariaLabel?: string;
/**
* Button state. Default: false.
*/
@@ -21,7 +25,7 @@ export type ButtonProps = {
/**
* Button shape. Default: rectangle.
*/
- shape?: 'rectangle' | 'square';
+ shape?: 'circle' | 'rectangle' | 'square';
/**
* Button type attribute. Default: button.
*/
@@ -34,6 +38,8 @@ export type ButtonProps = {
* Use a button as call to action.
*/
const Button: FC<ButtonProps> = ({
+ additionalClasses,
+ ariaLabel,
children,
disabled = false,
kind = 'secondary',
@@ -48,7 +54,8 @@ const Button: FC<ButtonProps> = ({
<button
type={type}
disabled={disabled}
- className={`${styles.btn} ${kindClass} ${shapeClass}`}
+ className={`${styles.btn} ${kindClass} ${shapeClass} ${additionalClasses}`}
+ aria-label={ariaLabel}
{...props}
>
{children}