@carbon/react
Version:
React components for the Carbon Design System
45 lines (39 loc) • 1.18 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 _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
var cx = require('classnames');
var PropTypes = require('prop-types');
var React = require('react');
var usePrefix = require('../../internal/usePrefix.js');
const Header = ({
className: customClassName,
children,
...rest
}) => {
const prefix = usePrefix.usePrefix();
const className = cx(`${prefix}--header`, customClassName);
return /*#__PURE__*/React.createElement("header", _rollupPluginBabelHelpers.extends({}, rest, {
className: className
}), children);
};
Header.propTypes = {
/**
* Optionally provide aria-label
*/
'aria-label': PropTypes.string,
/**
* Optionally provide aria-labelledby
*/
'aria-labelledby': PropTypes.string,
/**
* Optionally provide a custom class name that is applied to the underlying header
*/
className: PropTypes.string
};
exports.default = Header;