Angular パンくずリストコンポーネント | ng-hub-ui-breadcrumbs

Router 連携、カスタムテンプレート、RTL 対応、柔軟なスタイルトークンを備えた Angular パンくずリストコンポーネント。

インタラクティブなサンプル

一般的な Angular のユースケースでライブラリがどのように動作するかを示すライブサンプルをご覧ください。

基本のパンくず

基本のパンくず

ルート設定からそのまま読み取られるパンくず。追加の配線は不要です。

Items are generated from the data.breadcrumb configuration of active routes.

コード

動的なパンくず

動的なパンくず

ルートのプレースホルダーと resolver が返すデータからラベルを組み立てます。

The last crumb comes from a route declaring breadcrumb: "Dynamic: {name}", resolved with that route's data. This page has no router tree, so the demo is handed the resulting trail — the route configuration is in the TS tab.

コード

カスタムテンプレート

カスタムテンプレート

hubBreadcrumbItem テンプレートで各項目のマークアップを自分で用意します。

The hubBreadcrumbItem directive allows custom rendering of each element.

コード

パンくずのアイコン

パンくずのアイコン

ルートデータで宣言したアイコンを、カスタム項目テンプレートで描画します。

コード

RTL レイアウト

RTL レイアウト

右から左への対応。区切り文字はパンくずが来る側に配置されます。

コード

省略とツールチップ

省略とツールチップ

長いラベルを省略記号で切り詰め、ホバーで全文を表示します。

Each label is capped at --hub-breadcrumb-max-item-width (12rem). Only the items that overflow get a tooltip.

コード

長いパンくずの折りたたみ

Six crumbs, no collapsing — the default

maxItems = 4 — one crumb each side of the indicator

maxItems = 4 with two crumbs kept on each side

Indicator opened 0 time(s) — that is the collapsedClick output. The trail expands on its own and collapses again on the next navigation.

キーボードフォーカスリング

Default ring — press Tab to walk the trail

Re-tinted ring on the same markup

The ring reaches the collapsed indicator too, which is a button and therefore part of the tab order. Note where the overrides live: the focus tokens are declared on :host, so a value set on an ancestor never reaches them — put it on the <hub-breadcrumb> element or inside it. (The accent slot is the one exception, left undeclared on purpose so it does inherit.)

シグナルとしてのパンくず

INV-2026-0184

in Invoices · 5 levels deep

The heading and the crumbs are two readings of the same signal. Only the trail changes when you move; neither the header nor the component is told anything.