UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

45 lines (41 loc) 1.15 kB
/** * MSKCC 2021, 2024 */ import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js'; import cx from 'classnames'; import React__default from 'react'; import PropTypes from 'prop-types'; function SkipToContent(_ref) { let { children = 'Skip to main content', className: customClassName, href = '#main-content', tabIndex = 0, ...rest } = _ref; const className = cx('msk--skip-to-content', customClassName); return /*#__PURE__*/React__default.createElement("a", _extends({}, rest, { className: className, href: href, tabIndex: tabIndex }), children); } SkipToContent.displayName = 'SkipToContent'; SkipToContent.propTypes = { /** * A ReactNode to display in the SkipToContent `a` tag. * `'Skip to main content'` by default. */ children: PropTypes.string, className: PropTypes.string, /** * Provide the `href` to the id of the element on your package that is the * main content. `#main-content` by default. */ href: PropTypes.string, /** * Optionally override the default tabindex of 0 */ tabIndex: PropTypes.string }; export { SkipToContent };