Skip to main content

Breadcrumb

The TkBreadcrumb provides a navigational aid, allowing users to keep track of their location within the application's hierarchy.

import { TkBreadcrumb, TkBreadcrumbItem } from '@takeoff-ui/react'

Basic​

The basic usage of TkBreadcrumb demonstrates how to create a simple breadcrumb navigation using the model property.

View Code
const items = [
{ label: 'Home', href: '/', isExternal: true },
{ label: 'Library', href: '/library', isExternal: true },
{ label: 'Data', href: '/library/data', isExternal: true },
{ label: 'Current Page' },
];

<TkBreadcrumb model={items} />

Separator​

TkBreadcrumb offers various separator options to customize the visual appearance between items.


View Code
const items = [
{ label: 'Home', href: '/', isExternal: true },
{ label: 'Library', href: '/library', isExternal: true },
{ label: 'Data' },
];
<TkBreadcrumb model={items} separator="icon" />

Custom Icons​

Illustrates how to use custom icons for breadcrumb items and as separators.

View Code
const items = [
{ label: 'Home', href: '/', icon: 'home', isExternal: true },
{ label: 'Library', href: '/library', icon: 'local_library', isExternal: true },
{ label: 'Data', icon: 'data_usage' },
];
<TkBreadcrumb model={items} separatorIcon="navigate_next" />

Design Type​

Showcases the background type for TkBreadcrumb, providing a different visual style.

View Code
const items = [
{ label: 'Home', href: '/', isExternal: true },
{ label: 'Library', href: '/library', isExternal: true },
{ label: 'Data' },
];
<TkBreadcrumb model={items} type="outlined" />

Props​

NameTypeDefaultDescription
IBreadcrumbModel[]nullArray of breadcrumb items
"dot", "icon", "slash", "vertical"'icon'Type of separator to use between breadcrumb items
string'chevron_right'Icon to use as separator when separator is set to 'icon'
"basic", "outlined"'basic'Defines the visual style of the component, possible values are 'basic' and 'outlined'.

Slots​

NameDescription
defaultDefault slot to detect TkBreadcrumbItem components.

Interfaces​

interface IBreadcrumbModel {
/** Label text for the item */
label: string;
/** URL for the item */
href?: string;
/** Icon to display alongside the label */
icon?: string;
/** Whether the item is an external url */
isExternal?: boolean;
}

Props​

NameTypeDefaultDescription
stringnullURL for the item
IIconOptions, stringnullIcon to display alongside the label
booleanfalseIndicates if the item is the last one
booleanfalseWhether the item is an external url
stringnullLabel text for the breadcrumb item