UNPKG

@carbon/react

Version:

React components for the Carbon Design System

41 lines (35 loc) 1.06 kB
/** * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js'); var PropTypes = require('prop-types'); var React = require('react'); var cx = require('classnames'); var usePrefix = require('../../internal/usePrefix.js'); function FormItem({ className, children, ...rest }) { const prefix = usePrefix.usePrefix(); const classNames = cx(`${prefix}--form-item`, className); return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({ className: classNames }, rest), children); } FormItem.propTypes = { /** * Provide content to be rendered in the form item */ children: PropTypes.node, /** * Provide a custom className to be applied to the containing node */ className: PropTypes.string }; exports.default = FormItem;