nowo-tech / otp-input-bundle
Symfony OTP FormType with multi-input UI mapped to a single field value.
Package info
github.com/nowo-tech/OTPInputBundle
Type:symfony-bundle
pkg:composer/nowo-tech/otp-input-bundle
Fund package maintenance!
v1.0.0
2026-04-01 11:18 UTC
Requires
- php: >=8.1 <8.6
- symfony/config: ^6.0 || ^7.0 || ^8.0
- symfony/dependency-injection: ^6.0 || ^7.0 || ^8.0
- symfony/form: ^6.0 || ^7.0 || ^8.0
- symfony/framework-bundle: ^6.0 || ^7.0 || ^8.0
- symfony/http-kernel: ^6.0 || ^7.0 || ^8.0
- symfony/twig-bundle: ^6.0 || ^7.0 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: ^2.0
- symfony/browser-kit: ^6.0 || ^7.0 || ^8.0
- symfony/dom-crawler: ^6.0 || ^7.0 || ^8.0
- symfony/yaml: ^6.0 || ^7.0 || ^8.0
This package is auto-updated.
Last update: 2026-04-01 11:21:07 UTC
README
Star Found this useful? Install it from Packagist and support the project on GitHub.
Customizable Symfony OTP FormType with multiple visible inputs that map to a single field value.
FrankenPHP worker mode: Not declared as supported for this bundle at the moment.
Demo preview
Features
OtpType::classfor verification codes (2FA, email confirmation, magic code).- Multi-input UI rendered in Twig form themes.
- Stores data as one string value in your DTO/entity.
- Customizable length, classes, numeric/alphanumeric mode, and uppercase normalization.
- TypeScript + Vite assets in
src/Resources/assets.
Documentation
Additional documentation
Quick usage
use Nowo\OtpInputBundle\Form\OtpType; $builder->add('otpCode', OtpType::class, [ 'length' => 6, 'numeric_only' => true, 'container_class' => 'd-flex gap-2', 'input_class' => 'form-control text-center', 'gap_class' => 'otp-grid', ]);
The value received in otpCode is a single string like 123456.
Tests and coverage
- PHP: 100%
- TS/JS: 100%
- Python: N/A
