PHPackages                             shazzad/wp-form-ui - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. shazzad/wp-form-ui

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

shazzad/wp-form-ui
==================

A Form library for WordPress plugin &amp; theme development.

1.2.1(2y ago)37792[1 issues](https://github.com/shazzad/wp-form-ui/issues)MITPHP

Since May 17Pushed 2y ago2 watchersCompare

[ Source](https://github.com/shazzad/wp-form-ui)[ Packagist](https://packagist.org/packages/shazzad/wp-form-ui)[ Docs](https://github.com/shazzad/wp-form-ui)[ RSS](/packages/shazzad-wp-form-ui/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

WP Form UI
==========

[](#wp-form-ui)

WP Form UI is a powerful form library designed to simplify form rendering for WordPress plugin and theme development. This library provides a straightforward way to create and manage forms while ensuring flexibility and extensibility.

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

[](#installation)

You can install WP Form UI using either Composer or by cloning the repository from GitHub.

### Using composer

[](#using-composer)

```
$ composer require shazzad/wp-form-ui
```

### Using Git Clone

[](#using-git-clone)

```
$ git clone https://github.com/shazzad/wp-form-ui
```

Basic Usage
-----------

[](#basic-usage)

Follow these steps to integrate WP Form UI into your plugin or theme:

### 1. Define the base URL relative to the package path

[](#1-define-the-base-url-relative-to-the-package-path)

In your plugin or theme, add the following code:

```
use Shazzad\WpFormUi;

WpFormUi\Provider::setup();
```

### 2. Enqueue CSS &amp; Js

[](#2-enqueue-css--js)

To enqueue the required CSS and JS files, add the following code:

```
use Shazzad\WpFormUi;

add_action('wp_enqueue_scripts', function(){
    WpFormUi\Provider::enqueue_form_scripts();
});
```

### 3. Render the Form

[](#3-render-the-form)

To render the form, you need to define the form fields, their values, and other settings. Here's an example:

```
use Shazzad\WpFormUi;

// Field values
$values = [
    'id' => 1234
    'select-field' => 'option-1',
    'text-field' => 'some text',
    'repeater-field' => [
        [
            'type' => 'type-1',
            'name' => 'name-1',
            'address' => 'address-1'
        ],
        [
            'type' => 'type-2',
            'name' => 'name-2',
            'address' => 'address-2'
        ]
    ]
];

// Form fields
$fields = [
    [
        'priority'        => 10,
        'key'             => 'id',
        'name'            => 'id',
        'type'            => 'hidden'
    ],
    [
        'priority'        => 12,
        'key'             => 'select-field',
        'name'            => 'select-field',
        'type'            => 'select',
        'label'           => __('Select field'),
        'choices'         => []
    ],
    [
        'priority'        => 13,
        'key'             => 'text-field',
        'name'            => 'text-field',
        'type'            => 'text',
        'label'           => __('Text field')
    ],
    [
        'priority'        => 14,
        'key'             => 'repeater-field',
        'name'            => 'repeater-field',
        'type'            => 'repeater',
        'label'           => __('Repeater field'),
        'fields'          => [
            [
                'key'            => 'type',
                'name'           => 'type',
                'type'           => 'select',
                'label'          => __('Type'),
                'choices'        => []
            ],
            [
                'key'            => 'name',
                'name'           => 'name',
                'type'           => 'text',
                'label'          => __('Name'),
            ],
            [
                'key'            => 'address',
                'name'           => 'address',
                'type'           => 'textarea',
                'label'          => __('Address'),
            ]
        ],
        'values'          => ! empty($values['repeater-field']) ? $values['repeater-field'] : []
    ]
];

// Form settings
$settings     = [
    'ajax'            => true, // Set to true for AJAX form submission
    'action'          => admin_url('admin-ajax.php?action=do_something'),
    'id'              => 'my-form',
    'button_text'     => __('Update'),
    'loading_text'    => __('Updating'),
    'success_text'    => __('Form saved'),
];

$form = new WpFormUi\Form\Form();
$form->set_settings($settings);
$form->set_values($values);
$form->set_fields($fields);
$form->render();
```

### 4. Handle Form Submission

[](#4-handle-form-submission)

```
add_action('wp_ajax_do_something', function(){
    $data = stripslashes_deep($_POST);

    // Process the form data and update settings, e.g., update_option('my_settings', $data);

    wp_send_json([
        'success' => true,
        'message' => __('Form saved')
    ]);
});

// Handle submission for non-logged-in users
add_action('wp_ajax_nopriv_do_something', function(){
    // ... same as above
});
```

That's it! You have now successfully integrated WP Form UI into your WordPress plugin or theme. Customize the form fields and settings as per your requirements.

Contributing
------------

[](#contributing)

We welcome contributions from the community! If you find a bug, have a feature request, or want to contribute in any other way, please feel free to open an issue or submit a pull request.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~959 days

Total

3

Last Release

1051d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2789126?v=4)[Shazzad Hossain Khan](/maintainers/shazzad)[@shazzad](https://github.com/shazzad)

---

Top Contributors

[![shazzad](https://avatars.githubusercontent.com/u/2789126?v=4)](https://github.com/shazzad "shazzad (86 commits)")

---

Tags

wordpresswordpress-formwordpress-php-librarywordpressformwordpress-form

### Embed Badge

![Health badge](/badges/shazzad-wp-form-ui/health.svg)

```
[![Health](https://phpackages.com/badges/shazzad-wp-form-ui/health.svg)](https://phpackages.com/packages/shazzad-wp-form-ui)
```

###  Alternatives

[aristath/kirki

Extending the WordPress customizer

1.3k73.1k4](/packages/aristath-kirki)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.7k](/packages/afragen-git-updater)[tacowordpress/tacowordpress

WordPress custom post types that feel like CRUD models

232.2k](/packages/tacowordpress-tacowordpress)

PHPackages © 2026

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