View source: R/input-message.R
| calcite_input_message | R Documentation |
Creates a message component that displays validation messages, hints, and other contextual feedback for input components.
calcite_input_message(
...,
status = NULL,
icon = NULL,
icon_flip_rtl = NULL,
scale = NULL,
id = NULL
)
... |
Content for the message (default slot) - typically text or textOutput() |
status |
Status of the message: "idle", "valid", or "invalid" (default: "idle") |
icon |
Specifies an icon to display (TRUE for default or icon name) |
icon_flip_rtl |
When TRUE, icon is flipped in RTL direction (default: FALSE) |
scale |
Size of the component: "s", "m", or "l" (default: "m") |
id |
Component ID (optional) |
Input messages are typically used inside a calcite_label() component alongside
an input to provide contextual feedback, validation messages, or hints.
"valid": Green checkmark icon, success message
"invalid": Red warning icon, error message
"idle": Default state, informational message
Use textOutput() in the slot and renderText() in the server to create dynamic
validation messages. Use update_calcite() to change the status/icon properties.
An object of class calcite_component
# Static message
calcite_input_message(
"Username is available",
status = "valid",
icon = TRUE
)
# Dynamic message with textOutput
calcite_input_message(
shiny::textOutput("validation_msg"),
status = "invalid",
icon = "exclamation-mark-circle",
id = "msg"
)
# With input in a label
calcite_label(
label = "Username",
calcite_input_text(
id = "username",
placeholder = "Enter username"
),
calcite_input_message(
"Username must be 3-20 characters",
status = "idle"
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.