UNPKG

@carbon/react

Version:

React components for the Carbon Design System

38 lines (34 loc) 1.05 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. */ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js'; import cx from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js'; import { usePrefix } from '../../internal/usePrefix.js'; const Header = ({ className: customClassName, children, ...rest }) => { const prefix = usePrefix(); const className = cx(`${prefix}--header`, customClassName); return /*#__PURE__*/React.createElement("header", _extends({}, rest, { className: className }), children); }; Header.propTypes = { /** * Required props for the accessibility label of the header */ ...AriaLabelPropType, /** * Optionally provide a custom class name that is applied to the underlying <header> */ className: PropTypes.string }; export { Header as default };