@carbon/react
Version:
React components for the Carbon Design System
46 lines (40 loc) • 1.11 kB
JavaScript
/**
* 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.
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var cx = require('classnames');
var PropTypes = require('prop-types');
var React = require('react');
var usePrefix = require('../../internal/usePrefix.js');
const Content = ({
className: customClassName,
children,
tagName = 'main',
...rest
}) => {
const prefix = usePrefix.usePrefix();
const className = cx(`${prefix}--content`, customClassName);
return /*#__PURE__*/React.createElement(tagName, {
...rest,
className
}, children);
};
Content.propTypes = {
/**
* Provide children nodes to be rendered in the content container
*/
children: PropTypes.node,
/**
* Optionally provide a custom class name that is applied to the container
*/
className: PropTypes.string,
/**
* Optionally specify the tag of the content node. Defaults to `main`
*/
tagName: PropTypes.string
};
exports.default = Content;