UNPKG

@ryanhelsing/ry-ui

Version:

Framework-agnostic, Light DOM web components. CSS is the source of truth.

28 lines (22 loc) 506 B
# Toast ## `RyToast` (programmatic API) No HTML element needed. Call globally after ry-ui loads. ```js RyToast.success('Saved!'); RyToast.error('Something went wrong'); RyToast.warning('Please review'); RyToast.info('New update available'); // With options RyToast.success('Done!', { duration: 5000 }); // default: 3000ms ``` Common pattern: ```js async function saveData() { try { await api.save(data); RyToast.success('Saved!'); } catch (err) { RyToast.error(err.message); } } ```