react-bootstrap
Version:
Bootstrap 5 components built with React
27 lines (26 loc) • 733 B
JavaScript
"use client";
import classNames from 'classnames';
import * as React from 'react';
import { useContext } from 'react';
import FormContext from './FormContext';
import { useBootstrapPrefix } from './ThemeProvider';
import { jsx as _jsx } from "react/jsx-runtime";
const FormCheckLabel = /*#__PURE__*/React.forwardRef(({
bsPrefix,
className,
htmlFor,
...props
}, ref) => {
const {
controlId
} = useContext(FormContext);
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-check-label');
return /*#__PURE__*/_jsx("label", {
...props,
ref: ref,
htmlFor: htmlFor || controlId,
className: classNames(className, bsPrefix)
});
});
FormCheckLabel.displayName = 'FormCheckLabel';
export default FormCheckLabel;