Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow styling of Toast and custom icons #40

Closed
pke opened this issue Nov 17, 2020 · 3 comments · Fixed by #43
Closed

Allow styling of Toast and custom icons #40

pke opened this issue Nov 17, 2020 · 3 comments · Fixed by #43

Comments

@pke
Copy link

pke commented Nov 17, 2020

Thanks for the library. I wonder if there is an easy way to further style the toasts like changing their border radius? Could this be achieved via theming?

Furthermore could the lib support custom icons handed in as React components?

@pke pke changed the title Allow styling of Toast Allow styling of Toast and custom icons Nov 17, 2020
@ghost
Copy link

ghost commented Nov 17, 2020

solve it ?

@jeanverster
Copy link
Owner

Hi @pke - thanks for this, it definitely seems possible, I think one solution could also be to pass your own Toast component to replace the one provided, that way you would be able to customize the UI completely.. Will look into providing both options :)

jeanverster pushed a commit that referenced this issue Nov 24, 2020
fix: fix android crash when using inside scrollview - #34

fix: reference icon family correctly so as to allow custom close icon - #36

feat: allow custom styling of toast and closebutton - #40
github-actions bot pushed a commit that referenced this issue Nov 24, 2020
# [1.1.0](v1.0.25...v1.1.0) (2020-11-24)

### Features

* add `maxToasts` prop to limit number of toasts on screen - [#39](#39) ([2fc84c0](2fc84c0)), closes [#34](#34) [#36](#36) [#40](#40)
@dmlux
Copy link

dmlux commented Feb 17, 2021

Well, it seems that there are more extensive options for styling the toast, but what about custom icons? In my current project, an external designer has created his own icons and graphics, which are completely incompatible with the provided fonts in this project. I also need to add icons to the header of the toast, which is also currently not possible. Another problem I currently have with this library is that while I can change the icon, I am not allowed to change the styling of its wrapping container. I think a better solution would be to allow something like <ToastProvider position="BOTTOM" toastComponent={MyCustomToastComponent}/>. If you need listeners for actions like close, etc, you could provide an interface for properties that custom components need to implement. This solution would allow developers to also add custom action listeners to toasts to do other things like send requests when buttons are pressed, etc.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants