@carbon/react
Version:
React components for the Carbon Design System
37 lines (33 loc) • 993 B
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.
*/
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import cx from 'classnames';
import React from 'react';
import { usePrefix } from '../../internal/usePrefix.js';
import PropTypes from 'prop-types';
function SideNavLinkText({
className: customClassName,
children,
...rest
}) {
const prefix = usePrefix();
const className = cx(`${prefix}--side-nav__link-text`, customClassName);
return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
className: className
}), children);
}
SideNavLinkText.propTypes = {
/**
* Provide the content for the link text
*/
children: PropTypes.node.isRequired,
/**
* Provide an optional class to be applied to the containing node
*/
className: PropTypes.string
};
export { SideNavLinkText as default };