@carbon/react
Version:
React components for the Carbon Design System
39 lines (37 loc) • 1.15 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 classNames from "classnames";
import "react";
import PropTypes from "prop-types";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/UIShell/SideNavDetails.tsx
/**
* 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.
*/
const SideNavDetails = ({ children, className: customClassName, title, ...rest }) => {
const prefix = usePrefix();
return /* @__PURE__ */ jsxs("div", {
className: classNames(`${prefix}--side-nav__details`, customClassName),
...rest,
children: [/* @__PURE__ */ jsx("h2", {
className: `${prefix}--side-nav__title`,
title,
children: title
}), children]
});
};
SideNavDetails.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
title: PropTypes.string.isRequired
};
//#endregion
export { SideNavDetails as default };