MCPcopy Create free account
hub / github.com/adobe/react-spectrum / Breadcrumb

Function Breadcrumb

starters/hooks/src/Breadcrumbs.tsx:41–65  ·  view source on GitHub ↗
(props: BreadcrumbProps)

Source from the content-addressed store, hash-verified

39export type BreadcrumbProps = AriaBreadcrumbItemProps;
40
41export function Breadcrumb(props: BreadcrumbProps) {
42 let ref = useRef<HTMLAnchorElement>(null);
43 /*- begin highlight -*/
44 let {itemProps} = useBreadcrumbItem({...props, elementType: 'a'}, ref);
45 /*- end highlight -*/
46 let {hoverProps, isHovered} = useHover(props);
47 let {focusProps, isFocusVisible} = useFocusRing();
48
49 return (
50 <li className="react-aria-Breadcrumb">
51 <a
52 {...mergeProps(itemProps, hoverProps, focusProps)}
53 ref={ref}
54 href={props.isCurrent ? undefined : props.href}
55 className="react-aria-Link"
56 data-hovered={isHovered || undefined}
57 data-focus-visible={isFocusVisible || undefined}
58 data-current={props.isCurrent || undefined}
59 data-disabled={props.isDisabled || undefined}>
60 {props.children}
61 </a>
62 {!props.isCurrent && <ChevronRight size={14} />}
63 </li>
64 );
65}

Callers

nothing calls this directly

Calls 4

useHoverFunction · 0.90
useFocusRingFunction · 0.90
mergePropsFunction · 0.90
useBreadcrumbItemFunction · 0.85

Tested by

no test coverage detected