Password Card
This feature is only available in ESP-DASH Pro
A secure input card component for collecting and storing sensitive text data like passwords or secrets. Masks input values on the dashboard for enhanced privacy and security.
Initializer
/*
Password Card
Valid Arguments: (ESPDash dashboard, Card Type, const char* name)
*/
Card card1(&dashboard, PASSWORD_CARD, "Test Pass");
Callback
Password card requires a callback function which will be called when we receive a input from our dashboard. In setup block, we will be calling our attachCallback
function and provide a lambda (callback) function with a const char*
(character array) argument.
/*
We provide our attachCallback with a lambda function to handle incomming data
*/
card1.attachCallback([&](const char* value){
Serial.println("[Card1] Password Card Callback: "+String(value));
});
Updater
💡
Password card doesn’t require any updater as value is not passed back to dashboard.
Reference
This is a reference sketch showing positions for intializer and callback.
...
/* Password card initializer */
Card pass(&dashboard, PASSWORD_CARD, "Test Pass");
void setup() {
...
/* Password card callback */
pass.attachCallback([&](const char* value){
Serial.println("Password Callback Triggered: "+String(value));
});
}
void loop() {
...
}