@carbon/react
Version:
React components for the Carbon Design System
36 lines (34 loc) • 1.27 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2026
*
* 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 { usePrefix } from "../../internal/usePrefix.js";
import SideNavIcon from "./SideNavIcon.js";
import classNames from "classnames";
import "react";
import PropTypes from "prop-types";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/UIShell/SideNavHeader.tsx
/**
* Copyright IBM Corp. 2016, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const SideNavHeader = ({ children, className: customClassName, renderIcon: IconElement }) => {
return /* @__PURE__ */ jsxs("header", {
className: classNames(`${usePrefix()}--side-nav__header`, customClassName),
children: [/* @__PURE__ */ jsx(SideNavIcon, { children: /* @__PURE__ */ jsx(IconElement, {}) }), children]
});
};
SideNavHeader.displayName = "SideNavHeader";
SideNavHeader.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
isSideNavExpanded: PropTypes.bool,
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired
};
//#endregion
export { SideNavHeader as default };