Creative makki toast.
Easy to use, customizable & support promise
Build by Daniel Jimenez
- Easy to use
- Customizable
- Dark mode
- Lightweight
- Accessible
npm install makki-toast@latestAdd the makki toast and it will take care of render the alerts. From version 2.0.0 it's for Angular 21
import { Component } from '@angular/core'
import { RouterOutlet } from '@angular/router'
import { ToasterComponent } from 'makki-toast'
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, ToasterComponent],
templateUrl: './app.html',
styleUrl: './app.css'
})
export class App {
constructor() {}
}<app-toaster></app-toaster>
<router-outlet></router-outlet>import { ToastService } from 'makki-toast'
constructor(
private readonly toast: ToastService,
) {}this.toast.info({
title: 'Info toast',
description: 'Info toast message',
}); this.toast.success({
title: 'Success toast',
description: 'Success toast message'
}); this.toast.warning({
title: 'Warning toast',
description: 'Warning toast message'
}); this.toast.error({
title: 'Error toast',
description: 'Error toast message'
}); this.toast.action({
title: 'Action toast',
description: 'Action toast message',
button: {
title: 'View Details',
onClick: () => console.log('show')
},
}); this.toast.promise(
fetchData(),
{
loading: {
title: 'Loading...',
},
success: (data) => ({
title: 'Complete',
description: 'promise complete message'
}),
error: (err) => ({
title: 'Error',
description: err.message
})
}
); this.toast.promise(
fetchData(),
{
loading: {
title: 'Loading...',
},
success: (data) => ({
title: 'Complete',
description: DataComponent
}),
error: (err) => ({
title: 'Error',
description: err.message
})
}
); this.toast.promise(
fetchData(),
{
loading: {
title: 'Loading...',
},
success: (data) => ({
title: 'Complete',
description: {
component: DataComponent,
inputs: {
data: data
}
}
}),
error: (err) => ({
title: 'Error',
description: err.message
})
}
);
export class DataComponent {
@Input() data!: any;
}Find the full documentation on official documentation
