Skip to content

Document custom @event names for UI component plugins - #552

Merged
simonhamp merged 3 commits into
NativePHP:mainfrom
thelemon2020:docs/plugin-element-events
Oct 16, 2026
Merged

simonhamp merged 3 commits into
NativePHP:mainfrom
thelemon2020:docs/plugin-element-events

Conversation

@thelemon2020

Copy link
Copy Markdown
Contributor

Docs for NativePHP/mobile-air#432, which shipped in Mobile 4.6.0.

What changed

On the Plugins → UI Component Plugins page (mobile/4/plugins/ui-components.md):

  • New Custom Event Names section, marked since 4.6. It covers declaring names with element_events in nativephp.json or Element::elementEvents(), the matching onX() method and resolveProps() registration, how hyphenated names map (@link-tapped → onLinkTapped()), the naming rules, and that renderers keep using sendTextChangeEvent.
  • An aside warning that declared names are global at compile time, so a plugin that declares link takes over @link on nested component tags too.
  • element_events added to the manifest fields table.
  • The "Using It in an App" example used _change="updateLabel", the compiled form. It now shows @change="updateLabel", which is what app developers write.

🤖 Generated with Claude Code

thelemon2020 and others added 3 commits October 5, 2026 08:43
Mobile 4.6 lets UI plugins declare their own Blade event names
(element_events in nativephp.json, or Element::elementEvents()), so
apps can write @link or @scan instead of reusing @change. Also fixes
the app example, which used the compiled _change attribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The manifest example had single backslashes, which is invalid JSON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp merged commit 833f8b1 into NativePHP:main Oct 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants