@carbon/react
Version:
React components for the Carbon Design System
49 lines (43 loc) • 1.21 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 cx = require('classnames');
var PropTypes = require('prop-types');
var React = require('react');
var usePrefix = require('../../internal/usePrefix.js');
const SideNavItem = ({
className: customClassName,
children,
large = false
}) => {
const prefix = usePrefix.usePrefix();
const className = cx({
[`${prefix}--side-nav__item`]: true,
[`${prefix}--side-nav__item--large`]: large,
[customClassName]: !!customClassName
});
return /*#__PURE__*/React.createElement("li", {
className: className
}, children);
};
SideNavItem.propTypes = {
/**
* Provide a single icon as the child to `SideNavItem` to render in the
* container
*/
children: PropTypes.node.isRequired,
/**
* Provide an optional class to be applied to the containing node
*/
className: PropTypes.string,
/**
* Specify if this is a large variation of the SideNavItem
*/
large: PropTypes.bool
};
exports.default = SideNavItem;