passwordfield Component

Use the passwordfield component to display a field that obscures typed characters to protect sensitive data, such as passwords and API keys.

{
  "type": "passwordfield"
}

Properties

text
STRING [getter]

Get the password from the password field in an action with this property.

Caution

Don't pre-set a password text on the password field, deal with this in your backend logic.

font
FONT | null
null sets the default font

The FONT for this password field's text.

colour
COLOUR

The text colour (hex, hsv, rgb, user-defined colour constants, or Apple system colours e.g. Banana, systemOrangeColor). Default textColor

bordered
BOOL
Default: true

Set if this password field has a border or not.

background
COLOUR | null
null removes the background

The background COLOUR.

textinsets
OBJECT

A horizontal and vertical inset around the text.

horizontal
INTEGER
Default: 2, Range: 0-64

The inset on the left and right of the text.

vertical
INTEGER
Default: 4, Range: 0-64

The inset at the top and bottom of the text. Changing this will affect the calculated height of this text field.

focusring
BOOL
Default: true

If the focus ring is drawn when focused.

Also see Shared Properties.

Example Workflows

A password field with a button to reveal its contents

{
  "type": "view",
  "layout": "inline",
  "direction": "vertical",
  "components": [
    {
      "id": "passwordlabel",
      "type": "label",
      "text": "Password will appear here when pressing the button"
    },
    {
      "id": "passwordinput",
      "type": "passwordfield"
    },
    {
      "type": "button",
      "text": "Reveal Password",
      "events": [
        {
          "trigers": "actioned",
          "action": {
            "type": "json",
            "variables": {
              "password": "{value:passwordinput.text}"
            },
            "src": {
              "update": {
                "ids": {
                  "passwordlabel": {
                    "text": "{var:password}"
                  }
                }
              }
            }
          }
        }
      ]
    }
  ]
}