Skip to content

feat: support NativePHP custom SVG icons - #6

Merged
victorycodedev merged 2 commits into
mainfrom
feature/custom-svg-icons
Nov 4, 2026
Merged

victorycodedev merged 2 commits into
mainfrom
feature/custom-svg-icons

Conversation

@victorycodedev

Copy link
Copy Markdown
Owner

What changed?

  • Added custom SVG icon support using the NativePHP custom:name convention.
  • Preserved the existing icon() API and platform override precedence.
  • Supports shared custom icons and mixed SF Symbol, Material, and custom platform icons.
  • Added custom icon name validation in PHP and JavaScript.
  • Added iOS rendering across standard, dynamic, and native presentations.
  • Reuses the NativePHP 4.7 Android custom drawable resolver.
  • Updated documentation, compatibility information, API reference, and changelog.
  • Raised the NativePHP Mobile requirement from ^4.1 to ^4.7.

Why?

NativePHP Mobile 4.7 compiles application SVG icons into native iOS template assets and Android VectorDrawables. ToastKit previously transported custom:name values but its native presentation layer could not display them consistently.

How was it tested?

  • composer validate --strict
  • composer test: 194 passed, 389 assertions
  • node --test resources/js/tests/toastkit.test.js: 41 passed
  • git diff --check
  • Manually verified custom SVG icons on Android and iOS emulators.
  • Manually verified sparse icon updates and custom platform overrides without a shared icon name.

Platforms tested

  • PHP
  • JavaScript
  • Android
  • iOS
  • Not applicable / documentation only

Breaking changes?

No public API break. The minimum dependency is now NativePHP Mobile 4.7 because custom SVG assets rely on its native build pipeline. Applications on NativePHP Mobile 4.1 through 4.6 should remain on ToastKit 1.4.x until upgrading NativePHP.

Checklist

  • Tests were added or updated where appropriate.
  • Existing relevant tests pass.
  • Documentation was updated where necessary.
  • Public API and event/bridge compatibility were considered.
  • Android/iOS behavior parity was considered where relevant.
  • No unnecessary native dependencies were introduced.
  • No secrets, tokens, temporary logging, or debugging code were committed.
  • Native changes were tested in a generated NativePHP application where practical.

@victorycodedev
victorycodedev merged commit 7570253 into main Nov 4, 2026
2 checks passed
@victorycodedev
victorycodedev deleted the feature/custom-svg-icons branch November 4, 2026 19:46
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.

1 participant