ui.input_password

ui.input_password(
    id,
    label,
    value='',
    *,
    width=None,
    placeholder=None,
    update_on='change',
)

Create an password control for entry of passwords.

Parameters

id : str

An input id.

label : TagChild

An input label.

value : str = ''

Initial value.

width : Optional[str] = None

The CSS width, e.g., ‘400px’, or ‘100%’.

placeholder : Optional[str] = None

The placeholder of the input.

update_on : Literal[‘change’, ‘blur’] = 'change'

When should the input value be updated? Options are "change" (default) and "blur". Use "change" to update the input immediately whenever the value changes. Use "blur"to delay the input update until the input loses focus (the user moves away from the input), or when Enter is pressed.

Returns

: Tag

A UI element.

Notes

Server value

A string of the password input. The default value is unless value is provided.

See Also

Examples

#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file: app.py
from shiny import App, Inputs, Outputs, Session, reactive, render, ui

app_ui = ui.page_fluid(
    ui.input_password("password", "Password:"),
    ui.input_action_button("go", "Go"),
    ui.output_text_verbatim("value"),
)


def server(input: Inputs, output: Outputs, session: Session):
    @render.text
    @reactive.event(input.go)
    def value():
        return input.password()


app = App(app_ui, server)