{# Toast Notification Component ============================ Displays toast notifications for user feedback. Usage: {% from "components/toast.html" import toast %} {{ toast() }} Then trigger via JavaScript: window.showToast('Item saved successfully', 'success'); window.showToast('Something went wrong', 'error'); window.showToast('Please wait...', 'info'); Or via HX-Trigger response header from server: response.headers["HX-Trigger"] = json.dumps({ "showToast": {"message": "Saved!", "type": "success"} }) Types: success (green), error (red), info (blue) #} {% macro toast() %}
{% endmacro %}