diff --git a/src/components/form/Checkbox/index.tsx b/src/components/form/Checkbox/index.tsx index 097f078..9f3eb3e 100644 --- a/src/components/form/Checkbox/index.tsx +++ b/src/components/form/Checkbox/index.tsx @@ -1,13 +1,13 @@ import clsx from 'clsx'; -import React, { useId } from 'react'; +import React, { type ReactNode, useId } from 'react'; import { Icon } from '~/components/common/Icon'; import { useCombinedPropsWithKit } from '~/hooks'; import styles from './styles.module.scss'; -export interface CheckboxProps extends React.AllHTMLAttributes { - label?: string; +export interface CheckboxProps extends React.InputHTMLAttributes { + label?: string | ReactNode; onChange?: (e: React.ChangeEvent) => void; } @@ -32,7 +32,7 @@ export const Checkbox = React.forwardRef((props
- {label &&

{label}

} + {typeof label === 'string' ?

{label}

: label} ); });