Breadcrumbs allow users to keep track and maintain awareness of their locations within the app or website. They should be used for large sites and apps with hierarchically arranged pages.
There are following components included:
Breadcrumbs
BreadcrumbsItem
BreadcrumbsSeparator
BreadcrumbsCollapsed
Name | Type | Default | Description |
---|---|---|---|
component | string | 'div' | Component's HTML Element |
fontSizeIos | string | 'text-[17px]' | Font size in iOS theme |
fontSizeMaterial | string | 'text-[14px]' | Font size in Material theme |
Name | Type | Default | Description |
---|---|---|---|
active | boolean | false | Marks breadcrumb item as active/current (usually last item in breadcrumbs) |
colors | object | Object with Tailwind CSS colors classes | |
colors.bgIos | string | '' | |
colors.bgMaterial | string | 'bg-md-light-secondary-container dark:bg-md-dark-secondary-container' | |
colors.textActiveIos | string | 'text-black dark:text-white' | |
colors.textActiveMaterial | string | 'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container' | |
colors.textIos | string | 'text-black text-opacity-55 dark:text-white dark:text-opacity-55' | |
colors.textMaterial | string | 'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container' | |
component | string | 'div' | Component's HTML Element |
Name | Type | Default | Description |
---|---|---|---|
colors | object | Object with Tailwind CSS colors classes | |
colors.bgIos | string | 'bg-black bg-opacity-15 dark:bg-white dark:bg-opacity-15' | |
colors.bgMaterial | string | 'bg-md-light-secondary-container dark:bg-md-dark-secondary-container' | |
colors.dotBgIos | string | 'bg-black dark:bg-white' | |
colors.dotBgMaterial | string | 'bg-md-light-primary dark:bg-md-dark-primary' | |
component | string | 'div' | Component's HTML Element |
import React, { useRef, useState } from 'react';import {Page,Navbar,NavbarBackLink,BlockTitle,BlockHeader,Block,Breadcrumbs,BreadcrumbsItem,BreadcrumbsSeparator,BreadcrumbsCollapsed,Popover,List,ListItem,Link,} from 'konsta/react';export default function BreadcrumbsPage() {const isPreview = document.location.href.includes('examplePreview');const popoverTargetRef = useRef(null);const [popoverOpened, setPopoverOpened] = useState(false);return (<Page><Navbartitle="Breadcrumbs"/><Block strong inset>Breadcrumbs allow users to keep track and maintain awareness of theirlocations within the app or website. They should be used for large sitesand apps with hierarchically arranged pages.</Block><BlockTitle>Basic</BlockTitle><Block strongIos outlineIos><Breadcrumbs><BreadcrumbsItem><Link>Home</Link></BreadcrumbsItem><BreadcrumbsSeparator /><BreadcrumbsItem><Link>Catalog</Link></BreadcrumbsItem><BreadcrumbsSeparator /><BreadcrumbsItem active>Phones</BreadcrumbsItem></Breadcrumbs></Block><BlockTitle>Scrollable</BlockTitle><BlockHeader>Breadcrumbs will be scrollable if they don't fit the screen</BlockHeader><Block strongIos outlineIos><Breadcrumbs><BreadcrumbsItem><Link>Home</Link></BreadcrumbsItem><BreadcrumbsSeparator /><BreadcrumbsItem><Link>Catalog</Link></BreadcrumbsItem><BreadcrumbsSeparator /><BreadcrumbsItem><Link>Phones</Link></BreadcrumbsItem><BreadcrumbsSeparator /><BreadcrumbsItem><Link>Apple</Link></BreadcrumbsItem><BreadcrumbsSeparator /><BreadcrumbsItem active>iPhone 12</BreadcrumbsItem></Breadcrumbs></Block><BlockTitle>Collapsed</BlockTitle><Block strongIos outlineIos><Breadcrumbs><BreadcrumbsItem><Link>Home</Link></BreadcrumbsItem><BreadcrumbsSeparator /><BreadcrumbsCollapsedref={popoverTargetRef}onClick={() => setPopoverOpened(true)}/><BreadcrumbsSeparator /><BreadcrumbsItem active>iPhone 12</BreadcrumbsItem></Breadcrumbs></Block><Popoveropened={popoverOpened}className="breadcrumbs-popover"style={{ width: '120px' }}target={popoverTargetRef.current}onBackdropClick={() => setPopoverOpened(false)}><List nested><ListItemlinktitle="Catalog"onClick={() => setPopoverOpened(false)}/><ListItemlinktitle="Phones"onClick={() => setPopoverOpened(false)}/><ListItemlinktitle="Apple"onClick={() => setPopoverOpened(false)}/></List></Popover></Page>);}