PHPackages                             threadi/react-dialog - 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. threadi/react-dialog

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

threadi/react-dialog
====================

Provides a simple react-driven dialog-modal for WordPress-frontend.

1.1.0(2mo ago)0424↑25%GPL-3.0-or-laterJavaScript

Since Jul 23Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/threadi/react-dialog)[ Packagist](https://packagist.org/packages/threadi/react-dialog)[ RSS](/packages/threadi-react-dialog/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (6)Used By (0)

React Dialog
============

[](#react-dialog)

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

[](#requirements)

- composer to install this package.
- npm to compile the scripts.
- WordPress-plugin, theme or Code Snippet-plugin to embed them in your project.

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

[](#installation)

1. `composer require threadi/react-dialog`
2. Switch to `vendor/thread/react-dialog`
3. Run `npm i` to install dependencies.
4. Run `npm run build` to compile the scripts.
5. Add the codes from `doc/embed.php` to your WordPress-projekt (plugin or theme).

Configuration
-------------

[](#configuration)

Each dialog is configured with the following options as array:

- className
    - string with names the modal should become to set individual styles
- title
    - represents the title as single text
- hide\_title
    - value set to `true` to hide the title
- texts
    - array of texts for the dialog
    - each entry contains a single string
- buttons
    - array of buttons for the dialog
    - each entry is an array with following settings:
        - action
            - string of JavaScript to run on click
        - variant
            - string to define button-styling
            - possible values:
                - primary
                - secondary
            - this setting is optional
        - text
            - string for the button-text

Usage
-----

[](#usage)

### PHP

[](#php)

```
$dialog = array(
	'title' => 'My title',
	'texts' => array(
		'My text'
	),
	'buttons' => array(
		array(
			'action' => 'alert("ok");',
			'variant' => 'primary',
			'text' => 'Click here'
		),
	)
);
echo 'Some link';

```

### JavaScript

[](#javascript)

```
let dialog = array(
	'title' => 'My title',
	'texts' => array(
		'My text'
	),
	'buttons' => array(
		array(
			'action' => 'alert("ok");',
			'variant' => 'primary',
			'text' => 'Click here'
		),
	)
);
document.body.dispatchEvent(new CustomEvent("react-dialog-for-wordpress", config));

```

Custom styles
-------------

[](#custom-styles)

You can customize the output of the dialog with your custom css.

E.g.:

```
body.react-dialog-on-body.wp-core-ui .components-modal__frame.react-dialog {
 background-color: red;
}

```

FAQ
---

[](#faq)

### Is it possible to create multiple dialogs on one screen?

[](#is-it-possible-to-create-multiple-dialogs-on-one-screen)

No, this is not possible.

### How to open a new dialog after click on dialog-button?

[](#how-to-open-a-new-dialog-after-click-on-dialog-button)

Call your own function as callback for the button.

Example:

```
'action' => 'open_new_dialog()',

```

```
function open_new_dialog() {
 /* define your new dialog */
}

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance87

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

63d ago

### Community

Maintainers

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

---

Top Contributors

[![threadi](https://avatars.githubusercontent.com/u/16623633?v=4)](https://github.com/threadi "threadi (12 commits)")

### Embed Badge

![Health badge](/badges/threadi-react-dialog/health.svg)

```
[![Health](https://phpackages.com/badges/threadi-react-dialog/health.svg)](https://phpackages.com/packages/threadi-react-dialog)
```

###  Alternatives

[rupadana/filament-swiper

The Most Modern Mobile Touch Slider on Filamentphp

3715.1k2](/packages/rupadana-filament-swiper)[weareferal/matrix-field-preview

Add screenshot previews to matrix and neo fields, helping you publish content quicker.

1717.5k](/packages/weareferal-matrix-field-preview)[zenstruck/backup-bundle

Symfony Bundle that wraps backup commands

1710.2k](/packages/zenstruck-backup-bundle)[php-school/psx

PHP CLI Syntax Highlighter

195.1k](/packages/php-school-psx)

PHPackages © 2026

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