PHPackages                             nowo-tech/password-strength-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. nowo-tech/password-strength-bundle

ActiveSymfony-bundle[Validation &amp; Sanitization](/categories/validation)

nowo-tech/password-strength-bundle
==================================

Symfony PasswordType extension with configurable strength policies, live feedback, HTML pattern, and validator.

v2.2.0(2w ago)0820↓66.7%1MITPHPPHP &gt;=8.1 &lt;8.6CI passing

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/nowo-tech/PasswordStrengthBundle)[ Packagist](https://packagist.org/packages/nowo-tech/password-strength-bundle)[ Docs](https://github.com/nowo-tech/PasswordStrengthBundle)[ GitHub Sponsors](https://github.com/HecFranco)[ RSS](/packages/nowo-tech-password-strength-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (64)Versions (14)Used By (1)

Password Strength Bundle
========================

[](#password-strength-bundle)

[![CI](https://github.com/nowo-tech/PasswordStrengthBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/PasswordStrengthBundle/actions/workflows/ci.yml) [![Packagist Version](https://camo.githubusercontent.com/b74a7fa0048ebffc596e081a69da8c39df2e92a508db79d3ec1f7f4297de38da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f70617373776f72642d737472656e6774682d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/password-strength-bundle) [![Packagist Downloads](https://camo.githubusercontent.com/3a7ae77d9f645beddb14b40dd7c6071525eea5be6d409241e2f953e6ca3c310d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f70617373776f72642d737472656e6774682d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/password-strength-bundle) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![PHP](https://camo.githubusercontent.com/8e58b490725ac49cc8e463c473173681b324c9d92d7854275a785db013ca3de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f6c6f676f3d706870)](https://php.net) [![Symfony](https://camo.githubusercontent.com/b43d1688d52c63d771fe5f9f56c9120e3a4e9601779936d3dc0a436df1f874c3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d362e30253242253230253743253230372e34253242253230253743253230382e30253230253743253230382e312532422d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com) [![GitHub stars](https://camo.githubusercontent.com/5d68b5d7502065928515dbbd13a657d6ee651f3701eac1769c63dd19b0297cd1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f70617373776f72642d737472656e6774682d62756e646c652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/PasswordStrengthBundle) [![Coverage](https://camo.githubusercontent.com/fec0ef28c45a8d5dad43c2ab53d77a1178dfb90d9ea0109c5a929f0dcef3e03b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d3939253235253230504850253230253743253230393025323525323054532d627269676874677265656e)](#tests-and-coverage)

> ⭐ **Found this useful?** Give it a **star** on [GitHub](https://github.com/nowo-tech/PasswordStrengthBundle) so more developers can find it.

Symfony bundle that extends `PasswordType` with **100% configurable** password hardness: predefined **levels**, inline **conditions**, auto-built **HTML pattern**, live **TypeScript** feedback, and a **validator** constraint.

**FrankenPHP worker mode:** Supported — the bundle is stateless (form type + validator + client script); tested with the Symfony 8 demo using FrankenPHP worker in production `Caddyfile` (see [Demo with FrankenPHP](docs/DEMO-FRANKENPHP.md)).

Features
--------

[](#features)

- **PasswordStrengthType** — extends Symfony `PasswordType`
- **Policy modes** — `level` (weak/medium/strong/custom) or inline `conditions`
- **HTML `pattern`** — built automatically from the active policy
- **Live feedback** — TypeScript evaluates requirements and shows what is missing
- **Feedback position** — configurable `above` or `below` the input
- **PasswordStrength validator** — server-side enforcement with the same rules
- **Multi-framework Twig themes** — Bootstrap 3–5, Tailwind 2, Foundation 5–6, table/div layouts
- **PasswordToggleBundle** — optional show/hide toggle when that bundle is installed (auto-detected)
- **Vite + pnpm + TypeScript** assets (IIFE bundle for `assets:install`)
- **Translations** — DE, EN, ES, FR, IT, NL, PT (overridable from the app)

Installation
------------

[](#installation)

```
composer require nowo-tech/password-strength-bundle
```

Register the bundle (Flex does this automatically):

```
Nowo\PasswordStrengthBundle\PasswordStrengthBundle::class => ['all' => true],
```

Install public assets:

```
php bin/console assets:install
```

Include the script in your layout (or demo template):

```

```

Configuration
-------------

[](#configuration)

```
# config/packages/nowo_password_strength.yaml
nowo_password_strength:
  form_theme: bootstrap_5_layout.html.twig  # match your app layout
  feedback_position: below
  show_requirements: true
  live_feedback: true
  default_level: medium
  levels:
    weak:
      min_length: 6
    medium:
      min_length: 8
      require_lowercase: true
      require_uppercase: true
      require_digit: true
    strong:
      min_length: 12
      require_lowercase: true
      require_uppercase: true
      require_digit: true
      require_special: true
  use_password_toggle: true   # optional; auto-uses toggle when PasswordToggleBundle is installed
  # parent_form_type: ~      # null = auto; or set a FQCN to force a specific parent PasswordType
  generator_mode: off
```

PasswordToggleBundle compatibility (optional)
---------------------------------------------

[](#passwordtogglebundle-compatibility-optional)

`PasswordToggleBundle` is **not required**. With default settings the bundle works standalone using Symfony `PasswordType`.

When `PasswordToggleBundle` is installed, `PasswordStrengthType` automatically extends its `PasswordType` and renders the eye toggle **alongside** strength feedback and the optional password generator.

```
composer require nowo-tech/password-toggle-bundle symfony/ux-icons symfony/http-client
```

```
nowo_password_strength:
  use_password_toggle: true   # default; ignored if parent_form_type is set explicitly
  # Force Symfony parent even when PasswordToggleBundle is installed:
  # parent_form_type: Symfony\Component\Form\Extension\Core\Type\PasswordType
  # Force PasswordToggle parent (requires the bundle):
  # parent_form_type: Nowo\PasswordToggleBundle\Form\Type\PasswordType

nowo_password_toggle:
  toggle: true
  visible_icon: 'tabler:eye-off'
  hidden_icon: 'tabler:eye'
```

Per field:

```
$builder->add('password', PasswordStrengthType::class, [
    'use_password_toggle' => true,  // false = plain password input
    'generator_mode' => 'input',
]);
```

The generator syncs toggle icon/aria state when it fills the field as visible text.

Usage
-----

[](#usage)

```
use Nowo\PasswordStrengthBundle\Form\PasswordStrengthType;

$builder->add('plainPassword', PasswordStrengthType::class, [
    'policy_mode' => 'level',
    'level' => 'strong',
    'feedback_position' => 'below',
    'ui_framework' => 'bootstrap5',
]);
```

### Form type (inline conditions)

[](#form-type-inline-conditions)

```
$builder->add('plainPassword', PasswordStrengthType::class, [
    'policy_mode' => 'conditions',
    'conditions' => [ /* ... */ ],
    'generator_mode' => 'modal',  // off | input | modal
    'generator_count' => 4,       // suggestions in modal
]);
```

**Generator modes:**

- `off` — no generator (default)
- `input` — one click fills the field as visible text
- `modal` — opens a dialog with suggestions, copy and “Use this password”

### Validator constraint

[](#validator-constraint)

```
use Nowo\PasswordStrengthBundle\Validator\PasswordStrength;

#[PasswordStrength(policyMode: 'level', level: 'medium')]
public ?string $plainPassword = null;
```

### Available condition keys

[](#available-condition-keys)

KeyTypeDescription`min_length`intMinimum length`max_length`intMaximum length`require_lowercase`boolAt least one `a-z``require_uppercase`boolAt least one `A-Z``require_digit`boolAt least one digit`require_special`boolAt least one special char`special_chars`stringCharset for special chars`disallow_whitespace`boolNo spaces`not_contain`string\[\]Forbidden substrings`min_unique_chars`intMinimum unique characters`regex`stringCustom regex (server + pattern)Documentation
-------------

[](#documentation)

- [Installation](docs/INSTALLATION.md)
- [Configuration](docs/CONFIGURATION.md)
- [Usage](docs/USAGE.md)
- [Contributing](docs/CONTRIBUTING.md)
- [Changelog](docs/CHANGELOG.md)
- [Upgrading](docs/UPGRADING.md)
- [Release](docs/RELEASE.md)
- [Security](docs/SECURITY.md)
- [Engram](docs/ENGRAM.md)
- [Spec-driven development](docs/SPEC-DRIVEN-DEVELOPMENT.md)
- [GitHub Spec Kit](docs/SPEC-KIT.md)

### Additional documentation

[](#additional-documentation)

- [Demo with FrankenPHP](docs/DEMO-FRANKENPHP.md)
- [Demo (Symfony 8)](demo/symfony8/README.md)

Demo
----

[](#demo)

```
make -C demo up
# or: make -C demo/symfony8 up
```

Open **** (redirect from `/`; set `PORT` in `demo/symfony8/.env` if needed).

Tests and coverage
------------------

[](#tests-and-coverage)

LanguageCoverage (approx.)PHP~99% lines (`make test-coverage`)TypeScript~90% (`make test-ts`)```
make test
make test-ts
make test-coverage
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1, &lt; 8.6
- Symfony &gt;= 6.0 || &gt;= 7.0 || &gt;= 8.0

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

7

Last Release

17d ago

Major Versions

v1.3.0 → v2.0.02026-07-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7947bfc3f2ce9574a18a2c60f3d95b5d1b0740e65dc929332c92f1df21f75ab?d=identicon)[HecFranco](/maintainers/HecFranco)

---

Top Contributors

[![HecFranco](https://avatars.githubusercontent.com/u/24323276?v=4)](https://github.com/HecFranco "HecFranco (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (1 commits)")

---

Tags

symfonyvalidationsecuritypasswordtypescriptviteformSymfony Bundlepassword strength

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nowo-tech-password-strength-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nowo-tech-password-strength-bundle/health.svg)](https://phpackages.com/packages/nowo-tech-password-strength-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M430](/packages/easycorp-easyadmin-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M779](/packages/sylius-sylius)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M676](/packages/shopware-core)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.9M536](/packages/pimcore-pimcore)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1617.3k16](/packages/2lenet-crudit-bundle)[contao/core-bundle

Contao Open Source CMS

1301.7M3.1k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
