Angular タブ・ピル・アコーディオンコンポーネント | ng-hub-ui-panels

タブ、ピル、アコーディオンとしてレンダリングできる Angular コンテンツパネルコンポーネント。Router、リアクティブフォーム、キーボード操作、CSS 変数に対応します。

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

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

表示形式

1つのコンポーネントで3つのビューを利用できます:クラシックな下線付きタブ、角丸のピル、スタック式のアコーディオン開示パネル。単一の `type` 入力で切り替えられます。

基本的なタブ

The first enabled panel is activated automatically.
Switch panels with a click or the arrow keys.
Each panel projects its own content.

ピル

Account settings live here.
Password and two-factor options.
Email and push preferences.

accordion ビュー

カードとコンテンツスロット

Project summary
No tabs, no pills — every panel is always visible and styled as a card.
Team
The same hubPanelHeader / hubPanelFooter slots work in tabs, pills and accordion too.

A single standalone <hub-panel> (no container):

Standalone card
Dropped on its own, a hub-panel renders as a card by itself.

カードスロット(variant / flush / fill)

Success
A plain card honours [variant] — one accent tints the whole frame.
Danger
No colour values added — derived by color-mix like the alert.
Info
Set --hub-panels-card-border-style: dashed for an empty-state look.
Normal padding
Padded body — there is a gap around this strip.
Flush
Flush body — this strip runs edge-to-edge to the card sides.
Fill + scroll

Row 1 — the body scrolls; the header stays put.

Row 2 — the body scrolls; the header stays put.

Row 3 — the body scrolls; the header stays put.

Row 4 — the body scrolls; the header stays put.

Row 5 — the body scrolls; the header stays put.

Row 6 — the body scrolls; the header stays put.

Row 7 — the body scrolls; the header stays put.

Row 8 — the body scrolls; the header stays put.

Row 9 — the body scrolls; the header stays put.

Row 10 — the body scrolls; the header stays put.

Row 11 — the body scrolls; the header stays put.

Row 12 — the body scrolls; the header stays put.

Row 13 — the body scrolls; the header stays put.

Row 14 — the body scrolls; the header stays put.

Row 15 — the body scrolls; the header stays put.

Row 16 — the body scrolls; the header stays put.

Row 17 — the body scrolls; the header stays put.

Row 18 — the body scrolls; the header stays put.

Row 19 — the body scrolls; the header stays put.

Row 20 — the body scrolls; the header stays put.

セマンティックアラート

Heads up — a new version is available.
Your changes were saved successfully.
Your trial ends in 3 days.
Something went wrong while saving.
Tip: you can pin panels for quick access.
A neutral notice with no semantic variant.

An alert can use the same header/footer slots as a card:

Payment failed
We couldn't process your card. Update your billing details to keep your subscription active.

セマンティックストリップアクセント

The active tab follows the success accent.
Switch tabs to see the accent move.
No per-colour CSS — one accent drives it all.
The active pill fills with the danger accent.
Hover the inactive pills too.
Everything derives from a single token.
A custom or built-in variant works the same way.
Active pill uses the warning accent.

タブナビゲーション(コンテンツを持たないストリップ)

Overview

The tab strip owns no content — this view is rendered by the host from active().

Selected value: overview

ストリップレイアウト

あらゆるシェルに合わせてヘッダーストリップをレイアウトできます:コンテンツの横に縦に積み重ねる、ヘッダーを幅いっぱいに引き伸ばす、オーバーフローしたストリップをスクロール可能にする、といった配置が可能です。

垂直タブ

Your public profile information.
Invoices and payment methods.
Manage members and roles.

均等配置タブ

Today's agenda.
The seven-day view.
The full month at a glance.

スクロール可能なタブ

Content for section 1.
Content for section 2.
Content for section 3.
Content for section 4.
Content for section 5.
Content for section 6.
Content for section 7.
Content for section 8.

パネル管理

個々のパネルを無効化したり、✕ アフォーダンスと Delete キーを使ってユーザーがその場でパネルを追加・削除したりできます。

無効なパネル

This panel is selectable.
This panel is disabled.
Arrow keys skip the disabled panel.

削除可能 & 動的なパネル

Content for Tab 1.
Content for Tab 2.
Content for Tab 3.

カスタムテンプレート

`hubPanelHeading` ディレクティブを介して、プレーンテキストのヘッダーを任意の Angular テンプレート(アイコン、バッジ、インタラクティブなコントロール)に置き換えられます。

カスタム見出しテンプレート

Twelve unread messages.
Messages you have sent.
Recently deleted items.

アコーディオンの行アクション

フォーム統合

ファーストクラスの ControlValueAccessor サポートにより、アクティブなパネルを Angular のリアクティブフォームおよびテンプレート駆動フォームにバインドできます。

リアクティブフォーム統合

Light theme preview.
Dark theme preview.
Follows the OS setting.
Selected value: "dark"

複数選択

`multiple` を指定すると、複数のパネルを同時に開けます。アコーディオンビューではすべてが展開され、タブ/ピルビューでは各アクティブなヘッダーが独自の表示パネルを開始し、後続の非アクティブなヘッダーは、次のアクティブなヘッダーが新しいブロックを開始するまで、そのパネルの上にグループ化されたまま残ります。

複数選択

Click an inactive tab to split the layout into a new panel block. Click an active tab to merge that block back.

Key metrics and a quick overview of the account.
Detailed statistics and charts for the period.
A chronological feed of recent activity.
Free-form notes shared with the team.
Open panels: [ "summary", "stats" ]

複数の垂直ヘッダー

Each active header starts a new row-like vertical block. The blocks stack top-to-bottom, and the whole layout scrolls horizontally only when one row needs more width.

Tabs
Public profile details and biography.
Invoices, payment methods and VAT details.
Members, roles and access levels.
Shared internal notes for the account.
Open tabs: [ "profile", "team" ]
Pills
Open items waiting for review.
Approvals and pending checks.
Publication options and scheduling.
Historical records and exported snapshots.
Open pills: [ "inbox", "publish" ]

アコーディオンのオプション

アコーディオンビューは、複数のパネルを同時に展開する機能と、外側の装飾のないエッジトゥエッジの `flush` レイアウトをサポートします。

アコーディオンの複数表示 & フラッシュ

Standard delivery in 3–5 business days.

Free returns within 30 days.

アクセシビリティ

完全なキーボードナビゲーション(矢印キー、Home、End、Delete)、roving tabindex、そして tablist とアコーディオンの開示パターンの両方に対する正しい ARIA ロールを備えています。

キーボードナビゲーション

Focus a tab, then use ← → Home End. Press Delete on a removable tab to close it.

Use the arrow keys to move focus between headers.
Home and End jump to the first and last enabled header.
Press Delete while focused to remove this panel.