toas
v1.0.10
Published
Toas is a simple web component to show notifications without the need of any dependencies.
Downloads
37
Maintainers
Readme
[!NOTE]
This is in pre-beta
Thanks for your support Vite Source: https://x.com/MiguelGargallo/status/1736023947810885761?s=20
Usage
Look, you add the export function you can look at the directory for a Real case
<!-- Component.svelte -->
<script>
import Toas from '$lib/Toas.svelte';
function handleSuccess() {
window['showToas']('Operation Successful', 'success');
}
function handleError() {
window['showToas']('Operation Error', 'error');
}
function handleLoading() {
window['showToas']('Operation Loading', 'loading');
}
// This is an example
const yourFunction = ... {
... Your Code ...
handleLoading(); // Just invoke the function
... Your Code ...
{
... Your Code ...
handleSuccess(); // Just invoke the function
... Your Code ...
} catch (err) {
... Your Code ...
handleError(); // Just invoke the function
... Your Code ...
}
};
yourFunction();
</script>
<Toas />
your html goes here here
Initial config
Toas is a web component that will allow you to add notifications without the need of an external library.
In this version
We added colors to the notifications, and we are currently working on icons.
How to use it
Just copy and paste the code from here and use it like this file here.
About the License
This project is under the Pylar AI Creative ML Free License.