SEAM’s feedback layer covers three distinct interaction patterns: modals pause the user flow and request a decision, toasts surface non-blocking status messages that dismiss themselves, and the loader overlay signals that a long-running operation is in progress. All three are appended directly toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TheSerchCp/SEAM/llms.txt
Use this file to discover all available pages before exploring further.
document.body at call time, so they work from any page or component without a pre-existing mount point.
Modal
Modal is an async function that builds a confirmation dialog, appends it to document.body, and resolves once the markup is in the DOM. Interaction is handled entirely via event listeners — no polling, no returned promises for the user’s decision.
Props
Text displayed in the modal header.
HTML string rendered in the modal body. You can include any markup here.
Called when the user clicks the confirm button. If it returns an object with
success: false the modal stays open; any other return value (including undefined) closes the modal. The confirm button is disabled for the duration of the async call.Called when the user clicks Cancel or clicks the backdrop. The modal is removed before
onCancel is invoked.Label for the confirm button.
Label for the cancel button.
Optional custom
id for the confirm button. Useful when external code needs to reference the button (e.g. FormModal uses this to wire up FormValidator).When
true, the confirm button is rendered in red (bg-red-600) instead of blue.Modal appends its element directly to document.body. Clicking the semi-transparent backdrop or the Cancel button removes the element from the DOM. If onConfirm returns { success: false }, the modal remains visible so the user can correct the problem.Real-world example — Delete user confirmation (users.page.js)
FormModal
FormModal composes Modal and Form into a single create/edit dialog. It auto-generates the form body from a fields array, initialises any SelectField dropdowns, and wires up a FormValidator instance — all inside a single await call.
Props
Modal header text, e.g.
'Agregar Usuario' or 'Editar Usuario'.The
id written onto the inner <form> element. Should be unique per open modal.Same
fields array accepted by Form. See Form Components for the full field descriptor shape.Validation schema passed to
FormValidator. When non-empty, FormValidator is instantiated and attach() is called automatically after the modal renders. The confirm button is disabled until the form passes all rules.Label for the confirm button.
Label for the cancel button.
Receives a
formData plain object (built from new FormData(form)) and must return { success: true } to close the modal or { success: false } to keep it open.Add User flow from users.page.js
FormModal calls Modal() internally, which appends the dialog directly to document.body. You do not need to set innerHTML on a container element — simply await FormModal(...) and the modal appears immediately. It removes itself from the DOM when the user confirms or cancels.Toast
Toast creates a small notification banner, appends it to a #toast-container div (creating the container if it does not exist), and removes it after duration milliseconds.
Toast({ message, type, duration })
The notification text displayed inside the banner.
Controls the colour scheme and icon:
| Type | Border/BG tint | Icon |
|---|---|---|
success | Emerald | fa-circle-check |
error | Red | fa-circle-xmark |
warning | Amber | fa-triangle-exclamation |
info | Blue | fa-circle-info |
Auto-dismiss delay in milliseconds. Pass
0 to keep the toast on screen until the user manually closes it.Toast returns the generated toastId string so you can remove it programmatically if needed:
Convenience functions
Four pre-configured wrappers cover the most common cases:EventBus toast events
Toast.js registers five EventBus listeners at module load time. Any part of the application — including ApiClient — can trigger a toast without importing Toast directly:
| Event | Payload | Default duration |
|---|---|---|
toast:show | { message, type?, duration? } | Matches type default |
toast:success | { message, duration? } | 3 000 ms |
toast:error | { message, duration? } | 4 000 ms |
toast:warning | { message, duration? } | 3 500 ms |
toast:info | { message, duration? } | 3 000 ms |
ApiClient emits toast:success on successful responses and toast:error on failed ones automatically, so most API interactions surface feedback to the user with no additional code.Loader
Loader is a singleton full-screen overlay with a spinning indicator and a customisable message. It is ideal for wrapping slow operations such as page transitions or large data fetches.
Methods
Creates the
#global-loader element if it does not yet exist, sets the message text, and makes the overlay visible. Default message: 'Cargando...'.Updates the message text while the loader is already visible — useful for multi-step operations.
Hides the overlay.
EventBus integration
Loader also responds to operation:progress events so services can drive the overlay without importing Loader directly: