Skip to main content

Breadcrumb

The Breadcrumb component provides a navigation aid that helps users understand their location within a website or application.

Example Usage

import React from 'react';
import { Breadcrumb } from '@ginger-society/ginger-ui';

const paths = [
{ path: 'home', label: 'Home' },
{ path: 'home/accounts', label: 'Accounts' },
{ path: 'home/accounts/receivables', label: 'Receivables' }
];

const handleBreadcrumbClick = (path) => {
console.log('Breadcrumb clicked:', path);
// Implement navigation or any other logic here
};

export const BreadcrumbExample = () => (
<Breadcrumb value={paths} onClick={handleBreadcrumbClick} />
);

Demo

Props

PropTypeDescription
valueBreadcrumbItem[]Required. Array of breadcrumb items.
onClick(path: string) => voidRequired. Callback function called when a breadcrumb item is clicked.
PropTypeDescription
pathstringRequired. The path associated with the item.
labelstringRequired. The label to be displayed.

Example Usage

Basic Breadcrumb

import React from 'react';
import { Breadcrumb } from '@ginger-society/ginger-ui';

const paths = [
{ path: 'home', label: 'Home' },
{ path: 'home/accounts', label: 'Accounts' },
{ path: 'home/accounts/receivables', label: 'Receivables' }
];

const handleBreadcrumbClick = (path) => {
console.log('Breadcrumb clicked:', path);
// Implement navigation or any other logic here
};

const BasicBreadcrumb: React.FC = () => (
<Breadcrumb value={paths} onClick={handleBreadcrumbClick} />
);

export default BasicBreadcrumb;