Sensitive Field

Sensitive Field

Form Widget

sensitive - renders a revealable password field that can be used for sensitive information such as API keys or secrets, configuration values, etc. A sensitive field can be toggled visible and hidden at the user's request.

A sensitive field that contains a previously entered value will have the value replaced with a placeholder value on load, preventing the value from being guessed by length or copied. Upon revealing the value, the original value is retrieved by AJAX and populated into the field.

api_secret:
    type: sensitive
    allowCopy: false
    hideOnTabChange: true

The following field properties are supported and commonly used.

PropertyDescription
labela name when displaying the form field to the user.
defaultspecifies a default string value, optional.
commentplaces a descriptive comment below the field.
modedisplay mode for the widget, either textarea or text. Default: text
allowCopyadds a "copy" action to the sensitive field, allowing the user to copy the password without revealing it. Default: true
hiddenPlaceholdersets the placeholder text that is used to simulate a hidden, unrevealed value. You can change this to a long or short string to emulate different length values. Default: __hidden__
hideOnTabChangeif true, the sensitive field will automatically be hidden if the user navigates to a different tab, or minimizes their browser. Default: true
On This Page