Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

PROPOSAL: Icons and their usage in Buttons, Chip etc. #257

Open
theycallmehero opened this issue May 9, 2022 · 2 comments
Open

PROPOSAL: Icons and their usage in Buttons, Chip etc. #257

theycallmehero opened this issue May 9, 2022 · 2 comments

Comments

@theycallmehero
Copy link
Collaborator

theycallmehero commented May 9, 2022

Current implementation looks like this:
<Icon name="controls_plus" />

Or from Button
<Button right_icon="controls_plus" />

This is not good, because this implementation has 2 problems:

  1. It does not have error validation, that if there is no icon (this can be addressed with Surface prop values)
  2. This does not support custom icons / flags / anything else (that designs sometimes use, or external library users what to use)

I PROPOSE TO use slots and named icons:
<Button><:left_icon><ControlsPlus /></:left_icon></Button>

EDIT:
New version of LiveView/Surface supports components as arguments, so maybe this is not a as big problem.

@theycallmehero theycallmehero changed the title Icons and their usage in Buttons, Chip etc. PROPOSAL: Icons and their usage in Buttons, Chip etc. May 9, 2022
@anildigital
Copy link
Contributor

Proposal looks fine to me.

@alexisdevtailor
Copy link
Contributor

I agree with this approach 😊

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

No branches or pull requests

3 participants