UI Components for Angular
Use the package manager npm to install lbd component library.
npm install lbd
Import the prebuilt cdk overlay styles in your global stylesheet:
@import '~@angular/cdk/overlay-prebuilt.css';
...
import { ToastModule } from 'lbd';
@NgModule({
imports: [
...
ToastModule.forRoot() // pass your global toast configuration here
],
...
})
import { ToastService } from 'lbd';
@Component({...})
export class SampleComponent {
constructor(private toastService: ToastService) {}
showToast() {
this.toastService.show({
text: 'Your text',
type: 'success' // warning, error, info
});
}
}
// default configuration:
position: {
top: 10,
right: 5,
},
size: {
width: 350
},
animation: {
fadeOut: 120,
fadeIn: 120,
},
color: {
success: '#51a351',
error: '#bd362f',
warning: '#e38705',
info: '#2f96b4',
},
showProgress: true