PHPackages                             xanderid/pocketform - 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. xanderid/pocketform

ActiveLibrary

xanderid/pocketform
===================

PocketForm is a simple forms Library for PocketMine-MP.

1.0.7(9mo ago)0937apache-2.0PHPPHP ^8.1

Since Mar 17Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/XanderID/PocketForm)[ Packagist](https://packagist.org/packages/xanderid/pocketform)[ RSS](/packages/xanderid-pocketform/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

PocketForm
==========

[](#pocketform)

PocketForm is a powerful and flexible PHP library designed exclusively for creating interactive forms for [PocketMine-MP](https://github.com/pmmp/PocketMine-MP). With an intuitive API and a modular architecture, PocketForm allows developers to easily build various types of forms—ranging from simple button menus to complex custom forms with dynamic validation and interactive elements—tailored for PocketMine environments.

Table of Contents
-----------------

[](#table-of-contents)

- [PocketForm](#pocketform)
    - [Table of Contents](#table-of-contents)
    - [Features](#features)
    - [Installation](#installation)
    - [Getting Started](#getting-started)
    - [Usage Examples](#usage-examples)
        - [Creating a Simple Menu Form](#creating-a-simple-menu-form)
        - [Docs](#docs)
        - [What's New](#whats-new)

Features
--------

[](#features)

- **Multiple Form Types:**
    Create various form types including simple, custom, and modal forms.
- **Dynamic Form Elements:**
    Add interactive elements such as inputs, dropdowns, sliders, step sliders, toggles, and labels.
- **Custom Validation:**
    Use built-in validators or define your own using closures.
- **Event Handling:**
    Easily attach callback functions for response handling (`onResponse`), form closing (`onClose`), and button clicks (`onClick`).
- **Extensible Architecture:**
    Leverage traits and a modular design to extend and customize the library.

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

[](#installation)

To install **PocketForm**, use Composer:

add PocketForm to the Required Depencies list in your project like this:

```
"require": {
    "xanderid/pocketform": "^1.0.7"
  },
```

Alternatively, clone or download the repository:

```
git clone https://github.com/XanderID/PocketForm.git
```

Getting Started
---------------

[](#getting-started)

After installation, you can start creating forms immediately. PocketForm provides helper classes and traits that simplify form creation, element management, and response handling.

Usage Examples
--------------

[](#usage-examples)

### Creating a Simple Menu Form

[](#creating-a-simple-menu-form)

The SimpleForm is ideal for creating menu-based interfaces where the player selects from a list of buttons.

```
use XanderID\PocketForm\PocketFormHelper;
use XanderID\PocketForm\simple\SimpleFormResponse;

// Create a simple menu form with a title, body, and button options.
$form = PocketFormHelper::menu(
    'Main Menu',
    'Please select an option:',
    ['Play', 'Settings', 'Exit'],
    function (SimpleFormResponse $response) {
        $player = $response->getPlayer();
        // Process button selection using $response->getSelected()
    }
);

// Send the form to the player.
$player->sendForm($form);
```

Or you can use the Callable Builder:

```
use XanderID\PocketForm\PocketFormHelper;
use XanderID\PocketForm\Utils;
use pocketmine\player\Player;

$form = PocketFormHelper::menu(
    'Main Menu',
    'Please select an option:',
    ['Play', 'Settings', 'Exit'],
    Utils::createMenuCall([
        fn(Player $player) => $this->serverList($player),
        fn(Player $player) => $this->serverSettings($player)
    ])
);

// Send the form to the player.
$player->sendForm($form);
```

### Docs

[](#docs)

For additional documentation, please follow [this link](https://github.com/XanderID/PocketForm/tree/docs).

### What's New

[](#whats-new)

- Added static `create()` method to all Form and Element classes
- Added new `Divider` and `Header` elements for CustomForm and SimpleForm
- Added `Tooltip` support to several CustomForm elements
- Updated `PocketFormHelper::simple()` to use `Button[]` instead of `string[]`
- Renamed method `mergeElement()` to `mergeElements()` for consistency
- Refactored internal file structure (fully backward-compatible)
- Fixed various bugs and improved code stability

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance57

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.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 ~20 days

Recently: every ~6 days

Total

7

Last Release

298d ago

### Community

Maintainers

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

---

Top Contributors

[![XanderID](https://avatars.githubusercontent.com/u/55838823?v=4)](https://github.com/XanderID "XanderID (12 commits)")[![poggit-bot](https://avatars.githubusercontent.com/u/22427965?v=4)](https://github.com/poggit-bot "poggit-bot (1 commits)")

### Embed Badge

![Health badge](/badges/xanderid-pocketform/health.svg)

```
[![Health](https://phpackages.com/badges/xanderid-pocketform/health.svg)](https://phpackages.com/packages/xanderid-pocketform)
```

###  Alternatives

[muqsit/invmenu

A PocketMine-MP virion to create and manage virtual inventories!

2234.2k1](/packages/muqsit-invmenu)[sof3/libasynql

1427.8k3](/packages/sof3-libasynql)[muqsit/simple-packet-handler

Handle specific data packets (virion for PMMP API 4.0.0)

426.1k3](/packages/muqsit-simple-packet-handler)[dktapps/pmforms

Form API library for PocketMine-MP plugins

522.3k1](/packages/dktapps-pmforms)[sof3/infoapi

321.2k1](/packages/sof3-infoapi)[muqsit/asynciterator

A virion that simplifies writing tasks that traverse iterators

182.9k](/packages/muqsit-asynciterator)

PHPackages © 2026

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