aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/forms/toggle.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-08 22:36:24 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-08 23:31:58 +0200
commit0b3146f7278929c4d1b33dd8f94f34e351e5e5a9 (patch)
tree6a784b197a283a7da07c2e1df80a29fee8b3790a /src/components/atoms/forms/toggle.tsx
parent61278678ea8a8febee0574cd0f6006492d7b15cb (diff)
chore: add a Settings modal component
Diffstat (limited to 'src/components/atoms/forms/toggle.tsx')
-rw-r--r--src/components/atoms/forms/toggle.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/atoms/forms/toggle.tsx b/src/components/atoms/forms/toggle.tsx
index 7ef40ed..c3bc09d 100644
--- a/src/components/atoms/forms/toggle.tsx
+++ b/src/components/atoms/forms/toggle.tsx
@@ -27,6 +27,10 @@ export type ToggleProps = {
*/
label: string;
/**
+ * Set additional classnames to the label.
+ */
+ labelClassName?: string;
+ /**
* The label size.
*/
labelSize?: LabelProps['size'];
@@ -53,6 +57,7 @@ const Toggle: VFC<ToggleProps> = ({
choices,
id,
label,
+ labelClassName = '',
labelSize,
name,
setValue,
@@ -69,7 +74,7 @@ const Toggle: VFC<ToggleProps> = ({
className={styles.checkbox}
/>
<Label size={labelSize} htmlFor={id} className={styles.label}>
- <span className={styles.title}>{label}</span>
+ <span className={`${styles.title} ${labelClassName}`}>{label}</span>
{choices.left}
<span className={styles.toggle}></span>
{choices.right}