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

[Feature request] Icon props to buttons #32

Open
guastallaigor opened this issue Oct 24, 2018 · 2 comments
Open

[Feature request] Icon props to buttons #32

guastallaigor opened this issue Oct 24, 2018 · 2 comments

Comments

@guastallaigor
Copy link
Contributor

What problem does this feature solve?

Possibility to insert icons inside the buttons, left or right of the text, or maybe sometimes just the icon itself, kind of like the Loaders Upload Button of Vuetify's example.

What is your proposed solution?

1.Passing a new prop, icon prepend/append and/or a new <slot name="icon">:

iconPrepend: String,
iconAppend: String

2.It can uses the <va-icon> component.

3.Can work with the icon named slot or by passing the props.

@damienix
Copy link
Contributor

This idea is actually mentioned in Atlassian design :)
https://atlassian.design/guidelines/product/components/buttons

And it's also even implemented in React version of design as iconAfter and iconBefore
https://atlaskit.atlassian.com/packages/core/button

I think we just need to adjust the CSS to make something like this looke nicely

<va-button type="primary">
  <va-icon>edit</va-icon>
  Primary button
</va-button>

Let me check...

@damienix
Copy link
Contributor

Ok, I think it will require tweaking the markup to properly handle margins but it wouldn't require any slots or attributes. Atlassian uses prop with a renderer in it so something between a prop and a slot.

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

2 participants