@atlaskit/breadcrumbs
Version:
Breadcrumbs are a navigation system used to show a user's location in a site or app.
49 lines (48 loc) • 1.48 kB
JavaScript
/* breadcrumbs-item-primitive.tsx generated by @compiled/babel-plugin v3.0.2 */
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { forwardRef } from 'react';
import BreadcrumbsItemBase from './internal/breadcrumbs-item-base';
/**
* __BreadcrumbsItemPrimitive__
*
* A primitive breadcrumb item that renders an `<li>` with a separator and the
* correct link/button styling — without any overflow/collapse wiring.
*
* The `ref` is forwarded to the `<li>` element so it can be passed directly to
* `registerItem(index)` from `useOverflowCollapse`.
*
* @example
* ```tsx
* <BreadcrumbsItemPrimitive
* ref={registerItem(index)}
* href="/home"
* text="Home"
* />
* ```
*/
var BreadcrumbsItemPrimitive = /*#__PURE__*/forwardRef(function (_ref, ref) {
var text = _ref.text,
href = _ref.href,
onClick = _ref.onClick,
target = _ref.target,
elemBefore = _ref.elemBefore,
truncationWidth = _ref.truncationWidth,
testId = _ref.testId,
xcss = _ref.xcss,
ariaCurrent = _ref['aria-current'];
return /*#__PURE__*/React.createElement(BreadcrumbsItemBase, {
ref: ref,
href: href,
elemBefore: elemBefore,
onClick: onClick,
target: target,
testId: testId,
text: text,
truncationWidth: truncationWidth,
"aria-current": ariaCurrent,
xcss: xcss
});
});
// eslint-disable-next-line @repo/internal/react/require-jsdoc
export default BreadcrumbsItemPrimitive;