Skip to content

Commit 6e12683

Browse files
committed
refactor: add ReactNode support for labels
1 parent b43f1f7 commit 6e12683

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/components/form/CFormCheck.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { forwardRef, HTMLAttributes } from 'react'
1+
import React, { forwardRef, HTMLAttributes, ReactNode } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

@@ -50,7 +50,7 @@ export interface CFormCheckProps extends HTMLAttributes<HTMLInputElement> {
5050
/**
5151
* The element represents a caption for a component. [docs]
5252
*/
53-
label?: string
53+
label?: string | ReactNode
5454
/**
5555
* Size the component large or extra large. Works only with `switch` [docs]
5656
*
@@ -169,7 +169,7 @@ CFormCheck.propTypes = {
169169
id: PropTypes.string,
170170
inline: PropTypes.bool,
171171
invalid: PropTypes.bool,
172-
label: PropTypes.string,
172+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
173173
size: PropTypes.oneOf(['lg', 'xl']),
174174
switch: PropTypes.bool,
175175
type: PropTypes.oneOf(['checkbox', 'radio']),

0 commit comments

Comments
 (0)