Skip to content

Breadcrumbs

Breadcrumbs display a hierarchy of links to the current page or resource in an application.

Import

import { Breadcrumbs } from "@cfa/react-core";

Live Editor

Examples

Default

A simple breadcrumb navigation with three pages.

You can disable a link by setting the isDisabled prop. This is useful for indicating the current page.

Dynamic - Render Function

Out of the box, you can use the items prop and pass in an Iterable. This should include an id property in the object.

This allows you to use a render function to render the items. This handles some things behind the scenes like setting a key.

Dynamic - Array Map

You can also use the standard .map() option, but keep in mind that you will have to manually add the key to the Breadcrumb.Item

Dynamic - Custom Navigation

You can also choose not to use the href props and utilize the onAction prop perform a custom action when an item is clicked.

The value that is passed into this function is a Key and will be the id of the item.

Props

Visit the Documentation Site for the full list of props.

NameTypeDefaultDescription
aria-describedbystring-Identifies the element (or elements) that describes the object.
aria-detailsstring-Identifies the element (or elements) that provide a detailed, extended description for the object.
aria-labelstring-Defines a string value that labels the current element.
aria-labelledbystring-Identifies the element (or elements) that labels the current element.
childrenReactNode | ((item: T) => ReactNode)-The contents of the collection.
classNamestring'react-aria-Breadcrumbs'The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
dependenciesreadonly any[]-Values that should invalidate the item cache when using dynamic collections.
dirstring--
hiddenboolean--
idstring-The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
inertboolean--
itemsIterable<T>-Item objects in the collection.
langstring--
onAction(key: Key) => void-Handler that is called when a breadcrumb is clicked.
onAnimationEndAnimationEventHandler<HTMLOListElement>--
onAnimationEndCaptureAnimationEventHandler<HTMLOListElement>--
onAnimationIterationAnimationEventHandler<HTMLOListElement>--
onAnimationIterationCaptureAnimationEventHandler<HTMLOListElement>--
onAnimationStartAnimationEventHandler<HTMLOListElement>--
onAnimationStartCaptureAnimationEventHandler<HTMLOListElement>--
onAuxClickMouseEventHandler<HTMLOListElement>--
onAuxClickCaptureMouseEventHandler<HTMLOListElement>--
onClickMouseEventHandler<HTMLOListElement>--
onClickCaptureMouseEventHandler<HTMLOListElement>--
onContextMenuMouseEventHandler<HTMLOListElement>--
onContextMenuCaptureMouseEventHandler<HTMLOListElement>--
onDoubleClickMouseEventHandler<HTMLOListElement>--
onDoubleClickCaptureMouseEventHandler<HTMLOListElement>--
onGotPointerCapturePointerEventHandler<HTMLOListElement>--
onGotPointerCaptureCapturePointerEventHandler<HTMLOListElement>--
onLostPointerCapturePointerEventHandler<HTMLOListElement>--
onLostPointerCaptureCapturePointerEventHandler<HTMLOListElement>--
onMouseDownMouseEventHandler<HTMLOListElement>--
onMouseDownCaptureMouseEventHandler<HTMLOListElement>--
onMouseEnterMouseEventHandler<HTMLOListElement>--
onMouseLeaveMouseEventHandler<HTMLOListElement>--
onMouseMoveMouseEventHandler<HTMLOListElement>--
onMouseMoveCaptureMouseEventHandler<HTMLOListElement>--
onMouseOutMouseEventHandler<HTMLOListElement>--
onMouseOutCaptureMouseEventHandler<HTMLOListElement>--
onMouseOverMouseEventHandler<HTMLOListElement>--
onMouseOverCaptureMouseEventHandler<HTMLOListElement>--
onMouseUpMouseEventHandler<HTMLOListElement>--
onMouseUpCaptureMouseEventHandler<HTMLOListElement>--
onPointerCancelPointerEventHandler<HTMLOListElement>--
onPointerCancelCapturePointerEventHandler<HTMLOListElement>--
onPointerDownPointerEventHandler<HTMLOListElement>--
onPointerDownCapturePointerEventHandler<HTMLOListElement>--
onPointerEnterPointerEventHandler<HTMLOListElement>--
onPointerLeavePointerEventHandler<HTMLOListElement>--
onPointerMovePointerEventHandler<HTMLOListElement>--
onPointerMoveCapturePointerEventHandler<HTMLOListElement>--
onPointerOutPointerEventHandler<HTMLOListElement>--
onPointerOutCapturePointerEventHandler<HTMLOListElement>--
onPointerOverPointerEventHandler<HTMLOListElement>--
onPointerOverCapturePointerEventHandler<HTMLOListElement>--
onPointerUpPointerEventHandler<HTMLOListElement>--
onPointerUpCapturePointerEventHandler<HTMLOListElement>--
onScrollUIEventHandler<HTMLOListElement>--
onScrollCaptureUIEventHandler<HTMLOListElement>--
onTouchCancelTouchEventHandler<HTMLOListElement>--
onTouchCancelCaptureTouchEventHandler<HTMLOListElement>--
onTouchEndTouchEventHandler<HTMLOListElement>--
onTouchEndCaptureTouchEventHandler<HTMLOListElement>--
onTouchMoveTouchEventHandler<HTMLOListElement>--
onTouchMoveCaptureTouchEventHandler<HTMLOListElement>--
onTouchStartTouchEventHandler<HTMLOListElement>--
onTouchStartCaptureTouchEventHandler<HTMLOListElement>--
onTransitionCancelTransitionEventHandler<HTMLOListElement>--
onTransitionCancelCaptureTransitionEventHandler<HTMLOListElement>--
onTransitionEndTransitionEventHandler<HTMLOListElement>--
onTransitionEndCaptureTransitionEventHandler<HTMLOListElement>--
onTransitionRunTransitionEventHandler<HTMLOListElement>--
onTransitionRunCaptureTransitionEventHandler<HTMLOListElement>--
onTransitionStartTransitionEventHandler<HTMLOListElement>--
onTransitionStartCaptureTransitionEventHandler<HTMLOListElement>--
onWheelWheelEventHandler<HTMLOListElement>--
onWheelCaptureWheelEventHandler<HTMLOListElement>--
renderDOMRenderFunction<"ol", undefined>-Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: * You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). * Only a single root DOM element can be rendered (no fragments). * You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
slotstring-A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent.
styleCSSProperties-The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.
translate"yes" | "no"--