BreadcrumbA navigation component for displaying a route trail.
The Breadcrumb component is used to display a trail of links representing the current page's location within a navigational hierarchy. It supports dropdowns for subcategories and can be customized with different sizes and separators.
Install the Apsara library from the terminal.
Import and usage.
The
You can customize the separator between breadcrumb items using the
Breadcrumb items can include dropdowns for additional navigation options.
Breadcrumb items can include icons either alongside text or as standalone elements.
Control the visibility of breadcrumb items using the
npm install @raystack/apsara
<Breadcrumb size="small" items={[ { label: 'Home', href: '/' }, { label: 'Category', href: '/category' }, { label: 'Subcategory', href: '/category/subcategory' }, { label: 'Current Page', href: '/category/subcategory/current' } ]} />
Breadcrumb
component accepts the following props:
items
: Array of breadcrumb items with the following structure:label
: Text to display for the item (string)href
: URL for the item link (string)icon
: Optional icon element to display (ReactNode)dropdownItems
: Optional array of dropdown items, each withlabel
andhref
size
: Size variant of the breadcrumb ("small"
|"medium"
, default: "medium")maxVisibleItems
: Maximum number of items to display before showing ellipsis (number)separator
: Custom separator between items (ReactNode, default: "/")onItemClick
: Callback function when an item is clicked (Function)className
: Custom CSS class names
size
prop.
loading...
separator
prop.
loading...
loading...
loading...
maxVisibleItems
prop. By default, all items are visible when maxVisibleItems
is not specified.
loading...