UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

41 lines (37 loc) 994 B
/** * MSKCC 2021, 2024 */ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js'; import PropTypes from 'prop-types'; import React__default from 'react'; import cx from 'classnames'; import { usePrefix } from '../../internal/usePrefix.js'; function FormLabel(_ref) { let { className: customClassName, children, id, ...rest } = _ref; const prefix = usePrefix(); const className = cx(`${prefix}--label`, `${prefix}--label--no-margin`, customClassName); return /*#__PURE__*/React__default.createElement("label", _extends({ htmlFor: id, className: className }, rest), children); } FormLabel.propTypes = { /** * Specify the content of the form label */ children: PropTypes.node, /** * Provide a custom className to be applied to the containing <label> node */ className: PropTypes.string, /** * Provide a unique id for the given <FormLabel> */ id: PropTypes.string }; export { FormLabel as default };