shiny.ui.input_password#

shiny.ui.input_password(id, label, value='', *, width=None, placeholder=None)#

Create an password control for entry of passwords.

Parameters
  • id (str) – An input id.

  • label (Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[ForwardRef]]]]) – An input label.

  • value (str) – Initial value.

  • width (Optional[str]) – The CSS width, e.g. ‘400px’, or ‘100%’

  • placeholder (Optional[str]) – The placeholder of the input.

Return type

A UI element.

Notes

Server value

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

See also

update_text

Example

#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
from shiny import *

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):
    @output
    @render.text
    @reactive.event(input.go)
    def value():
        return input.password()


app = App(app_ui, server)