Skip to content

login class

A control that lets users enter their username and password.

Methods

__init__()

__init__(
    title="Log in",
    on_action=None,
    message=None,
    id=None,
    properties=None,
    class_name=None,
    hover_text=None,
) -> None

Create a new login element.

Parameters:

Name Type Description Default
title str

The title of the login dialog.

Log in
on_action Union[str, Callable]

A function or the name of a function that is triggered when the dialog button is pressed.

This function is invoked with the following parameters:

  • state (State): the state instance.
  • id (str): the identifier of the button if it has one.
  • payload (dict): the details on this callback's invocation.
    This dictionary has the following keys:
    • action: the name of the action that triggered this callback.
    • args: a list with three elements:
      • The first element is the username
      • The second element is the password
      • The third element is the current page name

When the button is pressed, and if this property is not set, Taipy will try to find a callback function called on_login() and invoke it with the parameters listed above.

None
message dynamic(str)

The message shown in the dialog.

None
id str

The identifier assigned to the rendered HTML component.
This can be used in callbacks or to target the element for styling.

None
properties dict[str, Any]

A dictionary of additional properties that can be set to the element.

None
class_name dynamic(str)

A space-separated list of CSS class names to be applied to the generated HTML element.
These classes are added to the default taipy-login class.

None
hover_text dynamic(str)

The text that is displayed when the user hovers over the element.

None