Introducing PrimeReact v11-alpha 🎉Discover Now

Breadcrumb

An unstyled breadcrumb component for building navigational hierarchies with full control over layout and styling.

Build fully custom breadcrumb navigation with complete control over layout and styling.

basic-demo

Pre-styled Versions

Choose a pre-styled library to use Breadcrumb with ready-made designs.
For hook-based usage without components, see the Headless API.

Features#

  • Compound component API with sub-components: Root, List, Item, Link, Current, Separator, Ellipsis
  • Semantic HTML structure with nav > ol > li hierarchy
  • Current page indicator with aria-current="page"
  • Presentational separators hidden from the accessibility tree

Usage#

import { Breadcrumb } from 'primereact/breadcrumb';
<Breadcrumb.Root>
    <Breadcrumb.List>
        <Breadcrumb.Item>
            <Breadcrumb.Link></Breadcrumb.Link>
        </Breadcrumb.Item>
        <Breadcrumb.Separator></Breadcrumb.Separator>
        <Breadcrumb.Item>
            <Breadcrumb.Current></Breadcrumb.Current>
        </Breadcrumb.Item>
    </Breadcrumb.List>
</Breadcrumb.Root>

Behavior#

Polymorphic Rendering#

Use as on any sub-component to change the rendered HTML element.

<Breadcrumb.Root as="div"></Breadcrumb.Root>
<Breadcrumb.Link as="button"></Breadcrumb.Link>

Default elements: Root=nav, List=ol, Item=li, Link=a, Current=span, Separator=li, Ellipsis=span.

Render Function Children#

Root accepts a render function as children, providing access to the component instance.

<Breadcrumb.Root>{(instance) => <ol>{/* custom breadcrumb items */}</ol>}</Breadcrumb.Root>

Pass Through#

Some parts may not be visible in the preview depending on the component's current state.

Loading...
/* Select a part to see its CSS selector for custom styling */

API#

NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: BreadcrumbRootInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: BreadcrumbRootInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceBreadcrumbRootInstance—
The instance to pass to the component.
ptSafeRecord<BreadcrumbRootPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: BreadcrumbRootInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
align"center" | "top" | "bottom" | "left" | "right"—
Alignment of the content.
orientation"horizontal" | "vertical"horizontal
Specifies the orientation, valid values are 'horizontal' and 'vertical'.
type"solid" | "dashed" | "dotted"solid
Border style type.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"breadcrumb"
data-part"root"

Defines passthrough(pt) options of Breadcrumb component.

labeltypedescription
rootBreadcrumbRootPassThroughType<HTMLAttributes<HTMLElement>>Used to pass attributes to the root's DOM element.
listBreadcrumbRootPassThroughType<HTMLAttributes<HTMLOListElement>>Used to pass attributes to the list's DOM element.
itemBreadcrumbRootPassThroughType<HTMLAttributes<HTMLLIElement>>Used to pass attributes to the item's DOM element.
separatorBreadcrumbRootPassThroughType<HTMLAttributes<HTMLLIElement>>Used to pass attributes to the separator's DOM element.
linkBreadcrumbRootPassThroughType<HTMLAttributes<HTMLAnchorElement>>Used to pass attributes to the link's DOM element.
currentBreadcrumbRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the current's DOM element.
ellipsisBreadcrumbRootPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the ellipsis's DOM element.
NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: BreadcrumbListInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: BreadcrumbListInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceBreadcrumbListInstance—
The instance to pass to the component.
ptSafeRecord<BreadcrumbListPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: BreadcrumbListInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"breadcrumb"
data-part"list"

Defines passthrough(pt) options of BreadcrumbList component.

labeltypedescription
rootBreadcrumbListPassThroughType<HTMLAttributes<HTMLOListElement>>Used to pass attributes to the root's DOM element.
NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: BreadcrumbItemInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: BreadcrumbItemInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceBreadcrumbItemInstance—
The instance to pass to the component.
ptSafeRecord<BreadcrumbItemPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: BreadcrumbItemInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"breadcrumb"
data-part"item"

Defines passthrough(pt) options of BreadcrumbItem component.

labeltypedescription
rootBreadcrumbItemPassThroughType<HTMLAttributes<HTMLLIElement>>Used to pass attributes to the root's DOM element.
NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: BreadcrumbLinkInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: BreadcrumbLinkInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceBreadcrumbLinkInstance—
The instance to pass to the component.
ptSafeRecord<BreadcrumbLinkPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: BreadcrumbLinkInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"breadcrumb"
data-part"link"

Defines passthrough(pt) options of BreadcrumbLink component.

labeltypedescription
rootBreadcrumbLinkPassThroughType<HTMLAttributes<HTMLAnchorElement>>Used to pass attributes to the root's DOM element.
NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: BreadcrumbCurrentInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: BreadcrumbCurrentInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceBreadcrumbCurrentInstance—
The instance to pass to the component.
ptSafeRecord<BreadcrumbCurrentPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: BreadcrumbCurrentInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"breadcrumb"
data-part"current"

Defines passthrough(pt) options of BreadcrumbCurrent component.

labeltypedescription
rootBreadcrumbCurrentPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the root's DOM element.
NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: BreadcrumbSeparatorInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: BreadcrumbSeparatorInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceBreadcrumbSeparatorInstance—
The instance to pass to the component.
ptSafeRecord<BreadcrumbSeparatorPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: BreadcrumbSeparatorInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"breadcrumb"
data-part"separator"

Defines passthrough(pt) options of BreadcrumbSeparator component.

labeltypedescription
rootBreadcrumbSeparatorPassThroughType<HTMLAttributes<HTMLLIElement>>Used to pass attributes to the root's DOM element.
NameTypeDefault
refRef<unknown>—
The reference to the component instance.
pIfbooleantrue
Whether the component should be rendered.
styleCSSProperties | ((instance?: BreadcrumbEllipsisInstance) => CSSProperties)—
The style to apply to the component.
classNamestring | ((instance?: BreadcrumbEllipsisInstance) => string)—
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>—
The component type to render.
asChildbooleanfalse
Whether the component should be rendered as a child component.
instanceBreadcrumbEllipsisInstance—
The instance to pass to the component.
ptSafeRecord<BreadcrumbEllipsisPassThrough>—
The pass-through props to pass to the component.
ptOptionsPassThroughOptions—
The pass-through options to pass to the component.
unstyledboolean—
Whether the component should be rendered without classes.
dtunknown—
The design token to use for the component.
stylesStylesOptions<ComponentInstance>—
The styles to use for the component.
render(instance: BreadcrumbEllipsisInstance) => ReactNode—
The render function to render the component with instance access.
childrenany—
The children to render. Accepts `React.ReactNode` for static content or a render function `(instance: I) => React.ReactNode` for instance access. Typed as `any` to avoid JSX type errors when used directly in templates.
[key: string]any—
pt-{optionName}-*-—
Pass through attributes for customizing component. For more info, see Pass Through tab.
AttributeValue
data-scope"breadcrumb"
data-part"ellipsis"

Defines passthrough(pt) options of BreadcrumbEllipsis component.

labeltypedescription
rootBreadcrumbEllipsisPassThroughType<HTMLAttributes<HTMLSpanElement>>Used to pass attributes to the root's DOM element.

Accessibility#

Screen Reader#

The root element uses nav with aria-label="Breadcrumb" to identify the navigation landmark. The list uses semantic ol > li structure. Separators have role="presentation" and aria-hidden="true" to be skipped by screen readers. The current page is marked with aria-current="page".

Keyboard Support#

KeyFunction
tabMoves focus through the breadcrumb links.