Estados y avisos
Notification Center
Agrupa notificaciones y ofrece acciones sobre su estado de lectura.
Importación
import { NeuNotificationCenterComponent } from '@neural-ui/native/notification-center';Ejemplos
Importa ExampleComponent en su padre y coloca <app-example /> dentro del neu-theme raíz de tu aplicación. El preview aporta el marco y las zonas seguras; utiliza la estructura raíz de Instalación en tu app.
Tu equipo, al día
Abre un aviso para marcarlo como leído y mostrar su detalle bajo la bandeja. Los avisos siguen disponibles después de leerlos.
Ver y copiar el ejemplo completo
import { Component, signal, computed } from '@angular/core';
import { NeuButtonComponent } from '@neural-ui/native/button';
import { NeuCardComponent } from '@neural-ui/native/card';
import { NeuNotificationCenterComponent } from '@neural-ui/native/notification-center';
import { View, Text, ScrollView } from '@ng-native/components';
import type { NeuOption } from '@neural-ui/native';
@Component({
selector: 'app-example',
imports: [NeuButtonComponent, NeuCardComponent, NeuNotificationCenterComponent, View, Text, ScrollView],
template: `
<scroll-view class="product-scroll" keyboardShouldPersistTaps="handled" [showsVerticalScrollIndicator]="true"><view class="product-stack"><view class="product-section"><text class="product-title" accessibilityRole="header">Tu equipo, al día</text><text class="product-caption">Espacio del producto</text></view>
<neu-notification-center emptyLabel="No hay avisos" unreadLabel="sin leer" markAllLabel="Marcar todo como leído" label="Avisos del equipo" [items]="notifications" [(readIds)]="readIds" (activated)="selected.set($event)" />
@if (openedNotification(); as notification) {
<neu-card [title]="notification.label" [description]="notification.description || ''" variant="outlined"><view class="product-section">
<text>{{ notification.id === 'invite' ? 'Abre el espacio del proyecto para aceptar la invitación y conocer al equipo.' : 'La revisión del lanzamiento ha terminado. Tu equipo puede preparar la siguiente versión.' }}</text>
<neu-button label="Cerrar detalles" size="sm" variant="text" (pressed)="selected.set('')" />
</view></neu-card>
}</view></scroll-view>
`,
styles: `
.actions { gap: 12px; align-items: flex-start; } text { color: var(--neu-text, #172033); font-size: 16px; }
:host { flex: 1; flex-shrink: 1; min-height: 0; }
.product-scroll { flex: 1; flex-shrink: 1; height: 0px; min-height: 0; }
.product-stack { gap: 24px; padding-bottom: 20px; }
.product-section { gap: 12px; }
.product-row { flex-direction: row; align-items: center; gap: 12px; }
.product-copy { flex: 1; min-width: 0; gap: 4px; }
.product-title { color: var(--neu-text, #172033); font-size: 24px; line-height: 30px; font-weight: 600; }
.product-heading { color: var(--neu-text, #172033); font-size: 17px; line-height: 23px; font-weight: 600; }
.product-caption { color: var(--neu-muted, #596477); font-size: 14px; line-height: 20px; }
.product-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.product-surface { gap: 16px; padding: 16px; border-radius: 16px; background-color: var(--neu-surface, #ffffff); border-width: 1px; border-color: var(--neu-border, #a5afbf); }
`,
})
export class ExampleComponent {
readonly notifications: readonly NeuOption[] = [
{
"id": "invite",
"label": "Nueva invitación a un proyecto",
"description": "Ada te ha invitado a Lanzamiento móvil."
},
{
"id": "review",
"label": "Revisión completada",
"description": "Las notas del lanzamiento están listas."
}
];
readonly readIds = signal<readonly string[]>(['review']);
readonly selected = signal('');
readonly openedNotification = computed(() => this.notifications.find(item => item.id === this.selected()));
}Playground interactivo
Ajusta la configuración y prueba el resultado.
Capturas del dispositivo en inglés.


Referencia API
Inputs
| Nombre | Tipo | Predeterminado | Enlace | Descripción |
|---|---|---|---|---|
| label | string | 'Notifications' | Input | Nombre legible del control, acción o grupo. |
| items | readonly NeuOption[] | [] | Input | Datos ordenados del componente. Utiliza el contrato siguiente e identificadores estables y únicos. |
| disabled | boolean | false | Input | Desactiva la interacción del usuario. La aplicación puede seguir proporcionando valores. |
| markAllLabel | string | 'Mark all read' | Input | Texto o nombre accesible utilizado para marcar todo como leído. No ejecuta la acción por sí solo. |
| unreadLabel | string | 'Unread' | Input | Texto o nombre accesible utilizado para notificaciones sin leer. No ejecuta la acción por sí solo. |
| emptyLabel | string | 'No notifications' | Input | Texto o nombre accesible utilizado para estado vacío. No ejecuta la acción por sí solo. |
Models
| Nombre | Tipo | Predeterminado | Enlace | Descripción |
|---|---|---|---|---|
| readIds | readonly string[] | [] | Model · bidireccional | IDs de las notificaciones marcadas como leídas. Enlaza una signal escribible mediante [(readIds)]. |
Outputs
| Nombre | Payload | Cuándo se emite |
|---|---|---|
| readIdsChange | readonly string[] | Emite el valor actualizado de readIds. [(readIds)] enlaza este output junto con su input model. |
| activated | string | Emite el ID del elemento activado. Tu aplicación ejecuta la acción. |
Estado de los models
Enlaza la signal con [(nombreModel)] sin llamarla. Utiliza nombreModel() para leer su valor.
import { signal } from '@angular/core';
// Fields inside your component class
readonly readIds = signal<readonly string[]>([]);Tipos e interfaces de datos
Utiliza los imports en tu aplicación. Las definiciones siguientes se muestran como referencia.
NeuOption
import type { NeuOption } from '@neural-ui/native';
// Public definition for reference only. Import this type; do not redeclare it.
export interface NeuOption {
readonly id: string;
readonly label: string;
readonly description?: string;
readonly disabled?: boolean;
}| Campo | Tipo | Requisito | Significado |
|---|---|---|---|
| id | string | Obligatorio | Identificador estable y único para seguimiento y selección. |
| label | string | Obligatorio | Nombre legible del elemento. |
| description | string | Opcional | Texto de apoyo opcional; su presentación depende del control. |
| disabled | boolean | Opcional | Impide activar o seleccionar este elemento. |