mirror of
https://github.com/hiaaryan/sileo.git
synced 2026-04-26 23:45:50 +03:00
[GH-ISSUE #4] Allow passing «type» to sileo.show() for dynamic toast state #3
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/sileo#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ivan-plotnikov on GitHub (Feb 15, 2026).
Original GitHub issue: https://github.com/hiaaryan/sileo/issues/4
Originally assigned to: @hiaaryan on GitHub.
Description
Currently, different toast states must be triggered via dedicated methods:
This works fine for static cases, but it becomes inconvenient when the toast state needs to be determined dynamically (e.g., based on runtime conditions).
Right now, there is no way to pass a type (or state) directly into sileo.show(). That forces developers to write conditional logic around different method calls instead of simply configuring a single call.
Problem Example
Instead of being able to write something like this:
We currently have to do something like:
This leads to duplicated configuration and less maintainable code.
Proposed Solution
Allow sileo.show() to accept a type (or state) property:
Then internally, sileo.show() would render the corresponding badge, icon, and colors depending on type.
Documentation Inconsistency
The documentation states:
sileo.show(options) — Generic toast without a state badgeHowever, in the current behavior, show() still displays the success icon and colors (similar to success). This is confusing and does not match the documentation.
P.S. The lib is awesome, thanks for such a great open source tool!