# SiPasswordStrengthDirective documentation

**Kind:** directive

**Selector:** `[siPasswordStrength]`

```
import { SiPasswordStrengthDirective } from '@siemens/element-ng/password-strength';
```

```
directive SiPasswordStrengthDirective implements Validator
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [siPasswordStrength](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L88-L94>) | `PasswordPolicy` | `{     minLength: 8,     uppercase: true,     lowercase: true,     digits: true,     special: true   }` | Define Siemens password strength. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [passwordStrengthChanged](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L101-L101>) | `number \| void` | Output callback event called when the password changes. The number indicated the number of rules which still can be met. (`-2` --\> 2 rules are still unmet, `0` --\> all met) |

### Types Documentation

### [PasswordPolicy](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L14-L46>)

**Kind:** interface

```
import type { PasswordPolicy } from '@siemens/element-ng/password-strength';
```

```
interface PasswordPolicy
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [allowWhitespace](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L38-L38>) (optional) | `boolean` | Whether to allow whitespaces. By default whitespaces are not allowed. |
| [digits](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L30-L30>) | `boolean` | Define if digits are required in password. |
| [lowercase](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L26-L26>) | `boolean` | Define if lowercase characters are required in password. |
| [minLength](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L18-L18>) | `number` | Define minimal number of characters. |
| [minRequiredPolicies](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L45-L45>) (optional) | `number` | Minimum required policies for valid password. When set to a number greater than 0, defines the number of policies that must be met for the password to be valid. E.g. when set to 3 and the policies uppercase/lowercase/digits/special are all set and the password contains 3 out of these four, the password will be valid. |
| [special](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L34-L34>) | `boolean` | Define if special characters are required in password. |
| [uppercase](<https://github.com/siemens/element/blob/main/projects/element-ng/password-strength/si-password-strength.directive.ts#L22-L22>) | `boolean` | Define if uppercase characters are required in password. |
