Composant Tabs, Pills et Accordion Angular | ng-hub-ui-panels

Composant de panneaux de contenu Angular qui se rend sous forme de tabs, pills ou accordion, avec routing, formulaires réactifs, navigation au clavier et variables CSS.

Vue d’ensemble

Pourquoi les équipes recherchent cette bibliothèque

Utilisez ce composant de panneaux Angular lorsque vous avez besoin de schémas tabs, pills et accordion à partir d'une seule API, avec des panneaux routés, le binding aux formulaires réactifs, la navigation au clavier et un theming via variables CSS.

Installation

npm install ng-hub-ui-panels

Aller à

Idéal pour

  • pages de paramètres
  • tabs de détail produit
  • accordions de FAQ
  • sections de tableau de bord

À propos de panels

ng-hub-ui-panels unifie tabs, pills et accordion en un seul composant Angular standalone construit sur les Signals. Il prend en charge les panneaux routés, le binding de formulaires via ControlValueAccessor, les bandes scrollables et verticales, ainsi qu'un theming complet via --hub-panels-*. Il remplace ng-hub-ui-accordion, dont il reprend la vue accordion tout en conservant le contrat de tokens --hub-accordion-*.

Guides de fonctionnalités

Visualisations

Un composant, trois vues : onglets soulignés classiques, pills arrondis et panneaux de divulgation accordion empilés — interchangeables via un seul input `type`.

Exemples:
Onglets basiques

Onglets basiques

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

Pills

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

Vue accordion

Cartes et emplacements de contenu

Cartes et emplacements de contenu

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.
Alertes sémantiques

Alertes sémantiques

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.
Accent sémantique de la barre

Accent sémantique de la barre

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.

Disposition de la bande

Disposez la bande d'en-tête pour s'adapter à toute interface : empilez-la verticalement à côté du contenu, étirez les en-têtes pour remplir la largeur, ou rendez défilable une bande en dépassement.

Exemples:
Onglets verticaux

Onglets verticaux

Your public profile information.
Invoices and payment methods.
Manage members and roles.
Onglets justifiés

Onglets justifiés

Today's agenda.
The seven-day view.
The full month at a glance.
Onglets défilables

Onglets défilables

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.

Gestion des panneaux

Désactivez des panneaux individuels et laissez les utilisateurs ajouter ou supprimer des panneaux à la volée grâce à l'affordance ✕ et à la touche Delete.

Exemples:
Panneaux désactivés

Panneaux désactivés

This panel is selectable.
This panel is disabled.
Arrow keys skip the disabled panel.
Panneaux supprimables et dynamiques

Panneaux supprimables et dynamiques

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

Templates personnalisés

Remplacez l'en-tête en texte brut par n'importe quel template Angular — icônes, badges ou contrôles interactifs — via la directive `hubPanelHeading`.

Exemples:
Modèles d'en-tête personnalisés

Modèles d'en-tête personnalisés

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

Intégration aux formulaires

Une prise en charge de premier plan de ControlValueAccessor lie le ou les panneaux actifs aux formulaires réactifs et template-driven d'Angular.

Exemples:
Intégration des formulaires réactifs

Intégration des formulaires réactifs

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

Sélection multiple

Avec `multiple`, plusieurs panneaux peuvent être ouverts en même temps. Dans la vue accordion, ils se déploient tous ; dans les vues tabs/pills, chaque en-tête actif démarre son propre panneau visible tandis que les en-têtes inactifs suivants restent regroupés au-dessus de ce panneau jusqu'à ce que l'en-tête actif suivant démarre un nouveau bloc.

Exemples:
Sélection multiple

Sélection 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" ]
En-têtes verticaux multiples

En-têtes verticaux multiples

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" ]

Options de l'accordion

La vue accordion prend en charge plusieurs panneaux déployés simultanément et une mise en page `flush` bord à bord sans habillage extérieur.

Exemples:
Accordéon multiple et épuré

Accordéon multiple et épuré

Standard delivery in 3–5 business days.

Free returns within 30 days.

Accessibilité

Navigation complète au clavier (flèches, Home, End, Delete), tabindex itinérant et rôles ARIA corrects pour les patterns tablist et accordion.

Exemples:
Navigation au clavier

Navigation au clavier

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.

Fonctionnalités clés

Changements récents

Version 22.1.0 - 6/22/26, 12:00 AM

added: New variant input on <hub-panels> selecting the semantic accent of the navigation strip (active/hover tab, active pill, active accordion header). Built-in variants (primary | success | danger | warning | info) use the exact design-system tints; any custom string is also accepted and derived with color-mix. Defaults to primary.

added: New group-accent tokens --hub-panels-accent, --hub-panels-accent-emphasis and --hub-panels-accent-subtle; the strip active/hover affordances now resolve through this single accent instead of being hard-wired to --hub-sys-color-primary*.

changed: The outer container chrome now inherits from the --hub-container-* base layer (re-base hook), so overriding a container token on a subtree re-bases the panels chrome. No visual change with default tokens.

Version 21.3.0 - 6/16/26, 12:00 AM

added: New alert appearance for a standalone <hub-panel>: appearance="alert" with a variant renders a semantic callout (role="alert").

added: New variant input (primary | success | danger | warning | info) selecting the alert colour; omit it for a neutral alert. Exported HubPanelAppearance and HubPanelVariant types.

added: New alert tokens (--hub-panels-alert-*); each variant re-points them at the --hub-sys-color-<variant>-{subtle,border-subtle,emphasis} family, so the alert inherits every theme and dark mode automatically.

Version 21.2.0 - 6/14/26, 12:00 AM

added: New card visualization (type="card"): a chromeless format with no navigation strip where every <hub-panel> is always visible and styled as a card.

added: A <hub-panel> can now be used standalone, outside any <hub-panels> container, rendering as a card on its own.

added: New content-slot directives hubPanelHeader and hubPanelFooter, rendering header/footer bands in every view, distinct from the navigational hubPanelHeading.

Version 21.1.1 - 6/12/26, 12:00 AM

added: New token: --hub-panels-header-bg, used by the tabs/pills strip background while defaulting to the panel surface.

added: New token: --hub-panels-pill-content-border-width, which controls the bordered card chrome in the pills content area.

changed: The active header background now defaults to --hub-panels-content-bg so the active tab/panel fusion stays aligned when themes retint the content surface.

changed: The pills content area is borderless by default; themes can opt back into a bordered card by overriding --hub-panels-pill-content-border-width.

Version 21.1.0 - 6/11/26, 12:00 AM

added: Multiple selection in the tabs/pills views: each open pane becomes its own bordered box placed next to the others (side by side when horizontal, stacked when vertical), with a per-pane minimum and scroll on overflow.

added: New tokens: --hub-panels-pane-min-width, --hub-panels-pane-min-height, --hub-panels-pane-gap, --hub-panels-nav-content-gap, --hub-panels-pill-gap.

fixed: Accordion content was always empty (two unselected ng-content slots); replaced with a single projection slot.

fixed: tabs and vertical tabs now render as a single bordered box around the strip and content together (not two boxes); pills gain spacing before a bordered content card.

changed: Smooth strip scrolling, not-allowed cursor on disabled headers, and full-width container.

Version 21.0.0 - 6/11/26, 12:00 AM

added: Initial release of ng-hub-ui-panels with tabs, pills and accordion visualizations.

added: ControlValueAccessor integration with single and multiple selection, bindValue and compareWith.

added: Routed panels via routerLink with route/full pathMatch and a <router-outlet> content area.

added: Keyboard navigation (arrows/Home/End/Delete), scrollable, vertical and justified strips.

added: Accordion view with multiple expansion, flush layout and an animated grid-based collapse.

added: Custom header templates through the hubPanelHeading directive and full --hub-panels-* theming.

changed: Supersedes ng-hub-ui-accordion; the accordion view honours the --hub-accordion-* token contract for theme compatibility.

Bibliothèques associées