aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/forms/select.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/atoms/forms/select.tsx')
-rw-r--r--src/components/atoms/forms/select.tsx15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/components/atoms/forms/select.tsx b/src/components/atoms/forms/select.tsx
index e434a82..a42dbda 100644
--- a/src/components/atoms/forms/select.tsx
+++ b/src/components/atoms/forms/select.tsx
@@ -1,7 +1,7 @@
import { ChangeEvent, FC, SetStateAction } from 'react';
import styles from './forms.module.scss';
-type SelectOptions = {
+export type SelectOptions = {
id: string;
name: string;
value: string;
@@ -9,6 +9,10 @@ type SelectOptions = {
export type SelectProps = {
/**
+ * Set additional classes.
+ */
+ classes?: string;
+ /**
* Field state. Either enabled (false) or disabled (true).
*/
disabled?: boolean;
@@ -43,7 +47,12 @@ export type SelectProps = {
*
* Render a HTML select element.
*/
-const Select: FC<SelectProps> = ({ options, setValue, ...props }) => {
+const Select: FC<SelectProps> = ({
+ classes = '',
+ options,
+ setValue,
+ ...props
+}) => {
/**
* Update select value when an option is selected.
* @param e - The option change event.
@@ -65,7 +74,7 @@ const Select: FC<SelectProps> = ({ options, setValue, ...props }) => {
return (
<select
- className={`${styles.field} ${styles['field--select']}`}
+ className={`${styles.field} ${styles['field--select']} ${classes}`}
onChange={updateValue}
{...props}
>