Feedback Card
Display a status message with an info, success, warning or danger indicator using dash::FeedbackCard.
The feedback card displays a text message together with a status indicator. Use it to report system state, the result of an operation, warnings or errors.





Constructor
dash::FeedbackCard<T> card(dashboard, name, initialStatus, initialMessage);Prop
Type
Template parameters:
Prop
Type
dash::FeedbackCard<const char*> feedback(dashboard, "Status");
dash::FeedbackCard<dash::string> network(dashboard, "Network", dash::Status::INFO, "Connecting");An overload without the dashboard argument creates the card without attaching it to a dashboard; attach it later with dashboard.add(card).
Status values
| Value | Meaning |
|---|---|
dash::Status::NONE | No status indicator (default). |
dash::Status::INFO | Informational message. |
dash::Status::SUCCESS | Operation completed successfully. |
dash::Status::WARNING | Warning condition. |
dash::Status::DANGER | Error or critical failure. |
Methods
setFeedback()
bool setFeedback(const char* message, dash::Status status);
bool setFeedback(const dash::string& message, dash::Status status); // T = dash::string onlySets the message and the status in one call. Returns true if either changed.
feedback.setFeedback("Light is on", dash::Status::SUCCESS);setMessage()
bool setMessage(const char* message);
bool setMessage(const dash::string& message); // T = dash::string onlySets the message and keeps the current status. Returns true if the message changed.
setStatus()
bool setStatus(dash::Status status);Sets the status and keeps the current message. Returns true if the status changed.
status()
dash::Status status() const;Returns the current status.
value()
const T& value() const;Returns the current message. Call it only when hasValue() returns true; the constructor always sets a message, so this holds unless you call removeValue().
Example
#include <Arduino.h>
#include <WiFi.h> // ESP32; use the networking headers for your board
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <ESPDash.h>
AsyncWebServer server(80);
ESPDash dashboard(server);
dash::FeedbackCard<const char*> feedback(dashboard, "Status");
void setup() {
// ... connect to Wi-Fi
server.begin();
feedback.setFeedback("System ready", dash::Status::SUCCESS);
dashboard.sendUpdates();
}
void loop() {
if (WiFi.RSSI() < -80) {
feedback.setFeedback("Weak Wi-Fi signal", dash::Status::WARNING);
} else {
feedback.setFeedback("System ready", dash::Status::SUCCESS);
}
dashboard.sendUpdates();
delay(3000);
}Notes
- With
T = const char*, the card stores the pointer and does not copy the string. Pass string literals or buffers that outlive the card. Usedash::stringfor messages built at runtime.




