Skip to main content

Breadcrumbs

import { Breadcrumbs } from '@enmovil/ui-design-system';

Shows a breadcrumb trail built from path, with an optional home icon and an area for actions on the right. Every crumb except the current one is a link, and onItemClick and onHomeClick fire before navigation so you can cancel it.

Properties​

PropertyTypeRequiredDefaultAllowed valuesDescription
pathBreadCrumbList[]Yes——Crumbs of the trail, from the top level to the current page. The last one is shown as plain text for the current page; with an empty list the home icon is shown as current. The component must be inside a React Router router.
isHomebooleanNotrue—Shows a home icon before the first crumb, linking to homePath. Defaults to true.
homePathstringNo'/'—Route the home icon links to. Defaults to /. Requires isHome.
breadcrumbActionsReactNode[]No[]—Elements shown on the right of the trail, such as buttons. Nothing is shown by default.

path​

An array of objects (BreadCrumbList). Each object has these fields:

FieldTypeRequiredDescription
labelstringYesText of the crumb.
linkstringYesRoute the crumb links to. Not used for the last (current) crumb.

Events​

NameSignatureWhen it fires
onItemClick((item: BreadCrumbList, index: number, event: MouseEvent<HTMLAnchorElement, MouseEvent>) => void)Fires before navigation. Call event.preventDefault() to cancel it. The current (last) crumb is not a link and does not fire.
onHomeClick((event: MouseEvent<HTMLAnchorElement, MouseEvent>) => void)Fires before navigation to homePath. Call event.preventDefault() to cancel it.

Children​

Breadcrumbs does not accept children.

Variants​

Loading examples…

Playground​

Change the controls to see how the properties affect the component. Values the controls don't cover come from the Default example.

Loading playground…

Storybook​

Open Breadcrumbs in Storybook to try every story with the full set of controls.