Skip to content

Add optional toast opacity support - #3

Merged
victorycodedev merged 1 commit into
mainfrom
feat/toast-opacity
Aug 31, 2026
Merged

Add optional toast opacity support#3
victorycodedev merged 1 commit into
mainfrom
feat/toast-opacity

Conversation

@victorycodedev

Copy link
Copy Markdown
Owner

What changed?

Added optional opacity support to ToastKit.

Developers can now make a toast translucent by calling opacity():

Toast::success('Saved successfully')
    ->opacity()
    ->show();

Calling opacity() without a value uses 0.8 opacity. A custom value between 0.0 and 1.0 can also be provided:

Toast::success('Saved successfully')
    ->opacity(0.6)
    ->show();

Opacity is completely opt-in. Toasts that do not use opacity() continue to render normally with no change to their existing appearance or behavior.

The feature works across Android and iOS and integrates with existing ToastKit features such as animations, presets, and toast updates.

Why?

This gives developers more control over the appearance of their toasts, making it possible to create softer or translucent toast styles without changing ToastKit's default appearance.

Existing applications are unaffected because opacity is only applied when explicitly requested.

How was it tested?

  • Tested the default opacity() value of 0.8.
  • Tested custom opacity values.
  • Tested minimum and maximum values, including 0.0 and 1.0.
  • Tested clamping of values outside the supported range.
  • Verified toasts without opacity() retain their existing appearance.
  • Verified opacity works with existing animations, presets, and toast updates.
  • Ran the existing test suite and plugin validation.

Platforms tested

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

Breaking changes?

None.

Opacity is opt-in and does not change the appearance or behavior of existing toasts.

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 34b16e4 into main Aug 31, 2026
2 checks passed
@victorycodedev
victorycodedev deleted the feat/toast-opacity branch August 31, 2026 09:32
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