PasswordInput

February 4, 2026 · View on GitHub

Password entry field with advanced capabilities for displaying, validation of correspondence and generation based on settings

Usage

import { PasswordInput } from "@docspace/ui-kit/components/password-input";
const settings = {
  minLength: 6,
  upperCase: false,
  digits: false,
  specSymbols: false,
};
<PasswordInput
  inputName="demoPasswordInput"
  emailInputName="demoEmailInput"
  inputValue={value}
  onChange={(e) => {
    set(e.target.value);
  }}
  clipActionResource="Copy e-mail and password"
  clipEmailResource="E-mail: "
  clipPasswordResource="Password: "
  tooltipPasswordTitle="Password must contain:"
  tooltipPasswordLength="from 6 to 30 characters"
  tooltipPasswordDigits="digits"
  tooltipPasswordCapital="capital letters"
  tooltipPasswordSpecial="special characters (!@#$%^&*)"
  generatorSpecial="!@#$%^&*"
  passwordSettings={settings}
  isDisabled={false}
  placeholder="password"
  onValidateInput={(a) => console.log(a)}
  onCopyToClipboard={(b) => console.log("Data " + b + " copied to clipboard")}
/>

Object with settings:

{
  minLength: 6,
  upperCase: false,
  digits: false,
  specSymbols: false
}

Check for compliance with settings is carried out on fly. As you type in required number of characters, progress bar will fill up and when all conditions are met, the color will change from red to green.

Depending on screen width of device, input will change location of elements.

When setting focus to input, tooltip will be shown with progress in fulfilling conditions specified in settings. When unfocused, tooltip disappears.

You can apply all the parameters of the InputBlock component to the component.

When button is pressed, copy data will be copied to clipboard and copy action will be blocked for 2 seconds. In future, the button is unlocked.

If emailInputName parameter value is empty, copy action will be disabled.

Properties

PropsTypeRequiredValuesDefaultDescription
autoCompletestring--new-passwordAllows you to set the component auto-complete
classNamestring---Accepts class
clipActionResourcestring---Translation of text for copying email data and password
clipCopiedResourcestring--CopiedText translation copy action to copy
clipEmailResourcestring--E-mailText translation email to copy
clipPasswordResourcestring--PasswordText translation password to copy
emailInputNamestring--Required to associate password field with email field
generatorSpecialstring--!@#$%^&*Set of special characters for password generator and validator
idstring---Allows you to set the component id
inputNamestring--passwordInputInput name
inputTypearray-text, passwordpasswordIt is necessary for correct display of values ​​inside input
inputValuestring---Input value
inputWidthstring---If you need to set input width manually
isDisabledbool--falseSet input disabled
onChangefunc---Will be triggered whenever an PasswordInput typing
onCopyToClipboardfunc---Will be triggered if you press copy button, return formatted value
onValidateInputfunc---Will be triggered whenever an PasswordInput typing, return bool value
passwordSettingsobject--Set of settings for password generator and validator
simpleViewbool--falseSet simple view of password input (without tooltips, password progress bar and several additional buttons (copy and generate password)
styleobj, array---Accepts css style
tooltipPasswordCapitalstring---Capital text translation tooltip
tooltipPasswordDigitsstring---Digit text translation tooltip
tooltipPasswordLengthstring---Password text translation is long tooltip
tooltipPasswordSpecialstring---Special text translation tooltip
tooltipPasswordTitlestring---Text translation tooltip
hideNewPasswordButtonbool--falseAllows to hide NewPasswordButton
isDisableTooltipbool--falseAllows to hide Tooltip
isTextTooltipVisiblebool--falseAllows to show text Tooltip

passwordSettings properties

PropsTypeRequiredValuesDefaultDescription
digitsbool--Must contain digits
minLengthnumber--Minimum password length
specSymbolsbool--Must contain special characters
upperCasebool--Must contain uppercase letters