PHPackages                             drago-ex/form - 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. [Templating &amp; Views](/categories/templating)
4. /
5. drago-ex/form

ActiveLibrary[Templating &amp; Views](/categories/templating)

drago-ex/form
=============

Helper classes for Nette forms with extended inputs and shortcuts.

v2.0.2(1mo ago)0371↑514.3%2MITPHPPHP &gt;=8.3 &lt;9CI passing

Since Dec 18Pushed 2w agoCompare

[ Source](https://github.com/drago-ex/form)[ Packagist](https://packagist.org/packages/drago-ex/form)[ RSS](/packages/drago-ex-form/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (30)Versions (16)Used By (2)

Drago Form
==========

[](#drago-form)

Drago Form is a lightweight and extendable form component built on top of the Nette Framework. It provides basic form input building blocks and a flexible Latte template for rendering Bootstrap 5 styled forms.

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/drago-ex/form/blob/main/license)[![PHP version](https://camo.githubusercontent.com/db230349e63d81e4ca563bfd9dd232cb00d99c0f989050e2f5493e8d29465c79/68747470733a2f2f62616467652e667572792e696f2f70682f647261676f2d6578253246666f726d2e737667)](https://badge.fury.io/ph/drago-ex%2Fform)[![Coding Style](https://github.com/drago-ex/form/actions/workflows/coding-style.yml/badge.svg)](https://github.com/drago-ex/form/actions/workflows/coding-style.yml)

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

[](#requirements)

- PHP &gt;= 8.3
- Nette Framework
- Composer
- Bootstrap
- Naja
- Node.js

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

[](#installation)

```
composer require drago-ex/form
```

Project files
-------------

[](#project-files)

File copying is handled automatically by [drago-ex/project-tools](https://github.com/drago-ex/project-tools), which must be installed in your project. Without it, copy the files manually according to the `copy` section in this package's `composer.json`. To skip this package, set `"skip": true` under `extra.drago-tools.packages.` in your root `composer.json`.

Examples
--------

[](#examples)

```
$form = new Drago\Form\Forms();

$form->addTextInput('username', 'Username')
     ->setAutocomplete(Drago\Form\Autocomplete::Username)
     ->setPlaceholder('Enter your username');

$form->addIntegerInput('age', 'Age')
     ->setMin(0)
     ->setMax(120);
```

ExtraForms
----------

[](#extraforms)

`ExtraForms` extends `Forms` with commonly used preconfigured fields:

- `addPasswordField()` - password input named `password`.
- `addPasswordConfirmationField()` - password confirmation named `verify`, validated against `password`.
- `addEmailField()` - email input named `email` with autocomplete and email validation.

Password rules
--------------

[](#password-rules)

`PasswordRules` provides reusable validation for strong passwords.

```
use Drago\Form\Rules\PasswordRules;

$form->addPasswordField()
	->addRule($form::MinLength, 'Password must be at least %d characters long.', 8)
	->addRule($form::Pattern, PasswordRules::strongMessage(), PasswordRules::strongPattern());
```

The strong password rule requires:

- at least 8 characters
- one uppercase letter
- one lowercase letter
- one number
- one special character
- no whitespace characters

Features
--------

[](#features)

- Autocomplete enum - standard values for HTML autocomplete.
- FluentAttributes trait - fluent setters for autocomplete and placeholder.
- Forms class - extended Nette Form with helper methods:
- `addTextInput()`, `addEmailInput()`, `addPasswordInput()`, `addIntegerInput()`, `addTextAreaForm()`
- Custom inputs: Input, IntegerInput (min/max), Textarea - all support fluent attributes.

Latte Template
--------------

[](#latte-template)

Use the provided Latte form template to render forms with Bootstrap 5 styling. The templates rely on Bootstrap 5 classes, so make sure Bootstrap is installed in your project:

```
{embed 'path/to/@form.latte', name: 'register', class: 'ajax'}
     {block form}
          {include input, name: 'username', columns: 6}
          {include input, name: 'email', columns: 6}

               {include submit, name: 'send'}

     {/block}
{/embed}
```

JavaScript setup
----------------

[](#javascript-setup)

Since the package is installed via Composer, add the following to your `package.json` to make the `drago-form` alias available in your bundler:

```
{
  "type": "module",
  "dependencies": {
    "drago-form": "file:vendor/drago-ex/form"
  }
}
```

Then run `npm install`.

JavaScript buttons disabled
---------------------------

[](#javascript-buttons-disabled)

Optionally, include the submit disable script to prevent multiple submits on valid form:

```
import SubmitButtonDisable from 'drago-form/submit-disable';
```

Password hide/show
------------------

[](#password-hideshow)

```
{embed 'path/to/@form.latte', name: 'add', class: 'ajax'}
     {import 'path/to/@form-password.latte'}
     {block form}
          {include password-toggle, name: 'password', columns: 12}
     {/block}
{/embed}
```

JavaScript show/hide password
-----------------------------

[](#javascript-showhide-password)

```
import PasswordToggle from 'drago-form/password-toggle';
import 'drago-form/styles/password-toggle';
```

JavaScript Tom select
---------------------

[](#javascript-tom-select)

```
import TomSelectHandler from 'drago-form/tom-select';
import 'drago-form/styles/tom-select';
```

```
{embed 'path/to/@form.latte', name: 'add', class: 'ajax'}
     {import 'path/to/@form-tom-select.latte'}
     {block form}
          {include selectTom, name: 'tom', columns: 12, class: 'select-tom'}
     {/block}
{/embed}
```

Notes
-----

[](#notes)

- Fully compatible with Nette Forms API - all original methods remain functional.
- Fluent methods are optional; you can still use standard Nette Form controls.
- Designed for type safety and clean, readable code.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance95

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~11 days

Recently: every ~6 days

Total

15

Last Release

32d ago

Major Versions

v1.0.13 → v2.0.02026-05-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5998929?v=4)[Zdeněk Papučík](/maintainers/accgit)[@accgit](https://github.com/accgit)

---

Top Contributors

[![accgit](https://avatars.githubusercontent.com/u/5998929?v=4)](https://github.com/accgit "accgit (99 commits)")

### Embed Badge

![Health badge](/badges/drago-ex-form/health.svg)

```
[![Health](https://phpackages.com/badges/drago-ex-form/health.svg)](https://phpackages.com/packages/drago-ex-form)
```

###  Alternatives

[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

911.7M6](/packages/nette-code-checker)[contributte/forms-bootstrap

Nette extension for Bootstrap forms

221.1M4](/packages/contributte-forms-bootstrap)[nette/web-project

Nette: Standard Web Project

10993.3k](/packages/nette-web-project)[tomaj/nette-api

Nette api

36273.2k8](/packages/tomaj-nette-api)[nepada/form-renderer

Latte template based form renderer for Nette forms with full support for Bootstrap 3, 4 &amp; 5.

11253.5k](/packages/nepada-form-renderer)

PHPackages © 2026

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