Toast
Notificaciones flotantes lanzadas desde el NeuToastService. Soporta 4 tipos semánticos y 4 posiciones de pantalla configurables.
TypeScript
import { NeuToastComponent, NeuToastService } from '@neural-ui/core/toast';TypeScript
import { NeuToastService, NeuToastContainerComponent } from '@neural-ui/core/toast';
// 1. Add the container in app.html once
// <neu-toast-container />
// 2. Inject and use it in any component
@Component({ ... })
export class MyComponent {
private toast = inject(NeuToastService);
// Change position globally for all toasts
this.toast.setPosition('bottom-right');
save(): void {
this.toast.success('Saved successfully', { title: 'Success' });
}
handleError(): void {
this.toast.error('An error occurred', { title: 'Error', duration: 8000 });
}
}