UNPKG

@carbon/react

Version:

React components for the Carbon Design System

41 lines (37 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 { 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 = { /** * 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 }; export { Header as default };