React Native · Components
Breadcrumb
Breadcrumb showing where the user is in the app (Home › Products › Phone).
4 exports
Live example
The preview runs in the browser with the web component; the native component takes the same props and looks the same on iOS and Android.
Preview
Code
Events
- Events appear here when you interact with the preview.
Short path, slash separator
Long path: maxItems={4}, the middle in the (…) menu
Project switcher: the current page without a link opens a menu
Only "‹ parent page" on phones (mobile="back")
Import
Breadcrumb
componentBreadcrumb showing where the user is in the app (Home › Products › Phone). The same items array as web's Breadcrumb; the last item is the current page.
- Links: if
hrefis an in-app pathNavigatorgoes to that screen, otherwise it is opened by the system; or passonPress. - Long paths: with
maxItemsthe middle pages are collected in a (…) menu (Menu; opens from the bottom on phones). Pages that do not fit wrap to the next line; very long names are truncated. - Sibling pages: when an item has
menu, the arrow next to it switches to pages at the same level. - Phone: by default the first page, (…) and the last two pages show; with
mobile="back"only "‹ Parent page". Touch targets are at least 44 dp. - Accessibility: the current page is read as "selected", separators are not read. Arrows flip in right-to-left languages.
Examples
BreadcrumbItem
interfaceA page in the Breadcrumb items array (same fields as web, plus onPress).
| Name | Type | Description |
|---|---|---|
label | ReactNode | Name of the page. |
href? | string | Address of the page. In-app paths like /products go to Navigator (openLink); others are opened by the system. If neither href nor onPress is given, the item is plain text. |
onPress? | () => void | Called on tap (instead of or together with href; called first). |
icon? | IconProp | Icon at the start of the text: a name, path data or an element. |
iconOnly? | boolean | Shows only the icon; the text is read to screen readers and shown as a tooltip on press and hold (e.g. a house icon for the home page). |
current? | boolean | Is this the current page? If omitted, the last item is the current page. |
menu? | readonly MenuEntry[] | Menu to switch to this page's siblings (e.g. switching projects). On a linked item a small arrow appears next to the text; on an unlinked item the text itself opens the menu. See MenuEntry. |
tooltip? | TooltipProp | Tooltip shown on press and hold. On an iconOnly item label is shown if not given. See TooltipProp. |
BreadcrumbMobile
typeBehavior on narrow screens (below 640 dp, phones) (same as web).
"collapse": The first page, a (…) menu revealing hidden pages, and the last two pages."back": Only a "‹ Parent page" link going one level up."full": Same as on wide screens; pages that do not fit wrap to the next line.
BreadcrumbProps
interfaceProps of the Breadcrumb component.
| Name | Type | Default | Description |
|---|---|---|---|
items | readonly BreadcrumbItem[] | Pages from the root to the current page. | |
separator? | ReactNode | A right-pointing arrow (›) | Separator between pages: text ("/", "·") or an element. |
maxItems? | number | Maximum number of pages shown. The rest are collected in a (…) menu after the first page; the first page and the last maxItems - 1 pages stay visible. | |
mobile? | BreadcrumbMobile | "collapse" | Behavior on narrow screens. See BreadcrumbMobile. |
label? | string | the `breadcrumb` text (`"Sayfa yolu"`) | Screen reader name of the navigation region. |
effect? | EffectProp | Effect of the links (e.g. "scale", "ripple"). Defaults to UIProvider appearance.defaults.breadcrumb.effect. | |
style? | StyleProp<ViewStyle> | Container style. | |
testID? | string | Test ID. |