Skip to content

nowo-tech/OTPInputBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OTP Input Bundle

CI Packagist Version Packagist Downloads License PHP Symfony GitHub stars Coverage

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

OTP Input Bundle demo

Features

  • OtpType::class for 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

About

Customizable Symfony OTP FormType with multiple visible inputs that map to a single field value.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors