Breadcrumb

breadcrumb — navigation trail

Pure SCSS, no JS. Renders an ordered list with aria-label="Breadcrumb" and aria-current="page" on the last item. Optional home icon on the left replaces the textual Úvod label.

Use on every internal page deeper than the homepage — it's a low-cost way to give users orientation and a one-click escape upward.

Install

npx czg-ui add breadcrumb

@import 'components/breadcrumb'; to app.scss. No JS.

Requires base.

Parameters

ParamTypeDefaultNotes
itemsarray[][['label' => '…', 'href' => '/path'], …]; last item without href = current
homeIconboolfalseFirst item as a home icon instead of text
homeHrefstring'/'Home link target
homeLabelstring'Úvod'aria-label for the icon
classstring\nullExtra class on the wrapper

Usage

{include /app/components/Navigation/breadcrumb.latte, items => [
    ['label' => 'Úvod',   'href' => '/'],
    ['label' => 'Eshop',  'href' => '/eshop'],
    ['label' => 'Krmiva', 'href' => '/eshop/krmiva'],
    ['label' => 'Granule pro psy'],   // current page — no href
]}

With home icon:

{include /app/components/Navigation/breadcrumb.latte,
    homeIcon => true,
    items    => [
        ['label' => 'Blog', 'href' => '/blog'],
        ['label' => 'Jak vybrat boudičku'],
    ]
}

When NOT to use

  • Single-page sites / 2-level apps — no value, just clutter
  • Inside modal/drawer flows — use the modal title instead

Live preview

ui.czechgroup.cz/component/breadcrumb

Další kategorie