SecretInput
Use the SecretInput to let users enter write-only secrets, such as API tokens. After a secret is stored, the input shows a fixed mask with a "Replace" button, so the secret can be changed but never displayed again.
When to use
- Users need to enter sensitive credentials such as API keys, or tokens.
- Users need to reenter sensitive credentials as part of a form where editing related form fields could lead to token exposure.
When not to use
- The data isn't sensitive and doesn't require masking (names, addresses, preferences). Use TextInput instead.
- Users need to enter multi-line sensitive data. Use TextArea with appropriate security considerations.
Content guidelines
Label (recommended)
Add a label that describes the purpose or context of the secret to be entered. It should be descriptive but short (1-2 words).
- Do: Token
- Do: Client secret
- Don't: Add your token here
Placeholder (required)
- Default text: Add secret
The default placeholder text works for most use cases, but if you customize the placeholder, do the following:
- Use the formula Add + [subject] or [Verb] + [subject].
- “Add” is the default verb for our placeholders. Don't replace it with alternatives such as “Enter,” “Fill,” or “Type,” unless there's a good reason to do so.
- Omit unnecessary articles (a, an, the).
- Don't add periods, ellipses, or exclamation marks.
Example: Add client secret
Don't use the placeholder for information users need to complete the task, as placeholders disappear when users start typing.
Hint (optional)
Use the hint (FormFieldMessages component) for information users need to avoid errors or work efficiently. Always provide any error messages here too.
Example: Paste the token from your provider’s account settings.
- Keep the hint short.
- Add periods after sentences.