New:Socket for Asana Is Now Available.Learn more
Get Started

@isoftdata/svelte-password-fields

Package Overview
Dependencies
Maintainers
13
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-password-fields

latest
npmnpm
Version
2.0.1
Version published
Weekly downloads
19
-83.76%
Maintainers
13
Weekly downloads
 
Created
Source

Svelte PasswordFields

This component handled

  • Check whether both password values are matched and meet(optionally) a set of validation rules.

Screenshot of the attachment component

Install

pnpm i @isoftdata/svelte-password-fields

Breaking changes

2.0.0

  • Require Svelte 5

Props

NameTypeDescriptionDefault Value
passwordstringThe password string entered.''
confirmPasswordstringThe confirm password string entered.''
passwordMismatchbooleanWhether there is a mismatch with the password and confirm password. An error message will be shown when there is a mismatchfalse
columnClassstringThe column with grid breakpoint bootstrap class for BOTH password and confirm password inputscol-12 col-md-6
passwordLabelstringThe label of the password input.Password
confirmPasswordLabelstringThe label of the confirm password input.Confirm Password
validationRulesValidationRules | undefinedAn object containing validation rules to be enforced and show in the UI. If undefinedundefined, validation will be ignored.
passwordInputHTMLInputElement | undefinedThe first password input field.undefined
passwordConfirmInputHTMLInputElement | undefinedThe confirm password input field.undefined
passwordIsValidbooleanWhether the password entered is valid based on the given validation rules. When validationRules are undefined, this will return truefalse

bind: the passwordInput or passwordConfirmInput to access the the underlying input's in the component. This is useful when you need to focus on the input field when the component is rendered or when there is a validation error.

ValidationRules

When using validation rules, you can bind the passwordIsValid prop to check if the currently entered password is valid based on the given validation rules.

interface ValidationRules {
	minimumPasswordLength?: number
	maximumPasswordLength?: number
	numberOfRequiredLowercaseCharacters?: number
	numberOfRequiredUppercaseCharacters?: number
	numberOfRequiredNumericCharacters?: number
	numberOfRequiredSpecialCharacters?: number
}

Example

<script lang="ts">
	import PasswordFields from '@isoftdata/svelte-password-fields'
	let passwordMismatch: boolean = false
</script>

<div class="container">
	<h1>PasswordFields</h1>

	<PasswordFields />
	<PasswordFields
		columnClass="col-12 col-md-4"
		passwordLabel="New Password"
		confirmPasswordLabel="Confirm New Password"
		bind:passwordMismatch
		validationRules={{
			minimumPasswordLength: 3,
			maximumPasswordLength: 10,
			numberOfRequiredLowercaseCharacters: 2,
			numberOfRequiredUppercaseCharacters: 2,
			numberOfRequiredNumericCharacters: 2,
			numberOfRequiredSpecialCharacters: 2,
		}}
	/>
	{#if passwordMismatch}
		<div class="alert alert-danger">Passwords do not match</div>
	{/if}
</div>

FAQs

Package last updated on 14 Aug 2026

Related posts