Password Field
#| standalone: true
#| components: [viewer]
#| viewerHeight: 200
library(shiny)
library(bslib)
ui <- page_fixed(
passwordInput(
"password",
"Password",
value = "mypassword1"
),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderText({ input$password })
}
shinyApp(ui, server)
library(shiny)
library(bslib)
ui <- page_fixed(
passwordInput(
"password",
"Password",
value = "mypassword1"
),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderText({ input$password })
}
shinyApp(ui, server)
No matching items
Relevant Functions
-
passwordInput
passwordInput(inputId, label, value = "", width = NULL, placeholder = NULL)
No matching items
Details
A password field creates a text box for password entry.
To add a password field to your app:
Add
passwordInput()
to the UI of your app to create a password field. Where you call this function will determine where the password field will appear within the app’s layout.Specify the
inputId
andlabel
arguments ofpasswordInput()
to define the identifier and label of the passsword field. Optionally, specify thevalue
argument to set the initial value of the password field.
The value of an input component is accessible as a reactive value within the server()
function. To access the value of a password field:
- Use
input$<password_field_id>
(e.g.,input$password
) to access the value of the password field. The server value of a password field is a string.