Tabs, Pills y Accordion para Angular | ng-hub-ui-panels
Componente de paneles de contenido para Angular que se renderiza como tabs, pills o accordion, con routing, formularios reactivos, navegación por teclado y variables CSS.
Ejemplos interactivos
Explora ejemplos en vivo que muestran cómo se comporta la librería en casos de uso habituales de Angular.
Visualizaciones
Un componente, tres vistas: tabs subrayadas clásicas, pills redondeadas y paneles de divulgación de acordeón apilados, intercambiables mediante un único input `type`.
Pestañas básicas
Pills
Vista de accordion
Tarjetas y slots de contenido
hubPanelHeader / hubPanelFooter slots work in tabs, pills and accordion too. A single standalone <hub-panel> (no container):
hub-panel renders as a card by itself. Slots de card (variant, flush, fill)
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.
Alertas semánticas
An alert can use the same header/footer slots as a card:
Acento semántico del strip
Disposición de la tira
Dispón la tira de cabeceras para adaptarse a cualquier shell: apílala verticalmente junto al contenido, estira las cabeceras para que ocupen todo el ancho, o haz que una tira que desborda sea desplazable.
Pestañas verticales
Pestañas justificadas
Pestañas desplazables
Gestión de paneles
Deshabilita paneles individuales y permite a los usuarios añadir o eliminar paneles sobre la marcha con el control ✕ y la tecla Delete.
Paneles deshabilitados
Paneles eliminables y dinámicos
Plantillas personalizadas
Reemplaza la cabecera de texto plano con cualquier template de Angular —iconos, badges o controles interactivos— mediante la directiva `hubPanelHeading`.
Plantillas de cabecera personalizadas
Acciones de fila del acordeón
Integración con formularios
El soporte de primer nivel de ControlValueAccessor vincula el panel o paneles activos a los formularios reactivos y basados en template de Angular.
Integración con formularios reactivos
Selección múltiple
Con `multiple`, varios paneles pueden estar abiertos a la vez. En la vista de acordeón todos se expanden; en las vistas de tabs/pills, cada cabecera activa inicia su propio panel visible, mientras que las cabeceras inactivas siguientes permanecen agrupadas por encima de ese panel hasta que la siguiente cabecera activa inicia un nuevo bloque.
Selección múltiple
Click an inactive tab to split the layout into a new panel block. Click an active tab to merge that block back.
Múltiples cabeceras verticales
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
Pills
Opciones del acordeón
La vista de acordeón admite varios paneles expandidos simultáneamente y un layout `flush` de borde a borde sin marco exterior.
Acordeón múltiple y flush
Accesibilidad
Navegación completa por teclado (flechas, Home, End, Delete), tabindex móvil y roles ARIA correctos tanto para el patrón de tablist como para el de divulgación de acordeón.
Navegación por teclado
Focus a tab, then use ← → Home End. Press Delete on a removable tab to close it.