Skip to content

Icon Toggle [new component request] #2375

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

Closed
hacknaked opened this issue Dec 23, 2016 · 15 comments
Closed

Icon Toggle [new component request] #2375

hacknaked opened this issue Dec 23, 2016 · 15 comments

Comments

@hacknaked
Copy link

hacknaked commented Dec 23, 2016

Would be great to include icon toggles as defined in https://material.io/guidelines/components/buttons.html#buttons-toggle-buttons

MDC has a nice implementation of this
https://material-components-web.appspot.com/icon-toggle.html

@fxck
Copy link
Contributor

fxck commented Dec 23, 2016

@hacknaked
Copy link
Author

hacknaked commented Dec 23, 2016

@fxck Yes, maybe an icon toggle can be implemented using exclusive selection button groups, but it seems wired to me (a group with only one element and two level html markup.

I'd prefer something like <md-icon-toggle>my-icon</md-icon-toggle>.

@jmcgoldrick
Copy link

jmcgoldrick commented Dec 24, 2016

How would md-icon-toggle work with different icon fonts etc? I've been doing something like this: http://plnkr.co/edit/zMJc32INjgQru1otxnUo?p=preview which is even nicer using the new NgIfElse

edit: updated plunk

@EladBezalel
Copy link
Member

MDC implementation is not following the material design spec (no outlines) -
We do have icon buttons

@hacknaked
Copy link
Author

@EladBezalel

MDC implementation is not following the material design spec

Well, It's really wired.

https://material.io/components/ links to https://github.com/material-components/material-components-web#useful-links. If you follow the Demos link you will reach the Icon Toggle demo I've post.

Seems that MDC Icon Toggle was made by the same guys that write Material Design Spec.

@EladBezalel
Copy link
Member

EladBezalel commented Jan 12, 2017

Well, https://material.io/components/ is the website for https://github.com/material-components/material-components-web#useful-links.

They're not the same guys and even if they're, if its not in the spec, we won't implement it.

@hacknaked
Copy link
Author

hacknaked commented Jan 12, 2017

@EladBezalel

But, what's the official Material spec?
In your first comment you linked to https://material.io/guidelines

Are you saying that people who write https://material.io/guidelines are not the same that people who implement https://material.io/components? Why both projects share material.io domain if they don't follow the same spect? Sorry, for dumb questions, but it's confusing.

@EladBezalel
Copy link
Member

Yes, just as the people that write material.angular.io are not the same as augury.angular.io

@cesartolosa
Copy link

cesartolosa commented Feb 18, 2017

I am confused @EladBezalel

MDC implementation is not following the material design spec

I visited the link you shared and Icon toggles is included in the material design spec as part of the Toggle buttons section, so I think that something like <md-icon md-icon-toggles>my_icon</md-icon> would be perfect.

@EladBezalel
Copy link
Member

I'm talking about outlining the icon itself, this part is not included in the material design spec.

You can totally have icon buttons as simple as:

<button mdIconButton>
  <md-icon>my_icon</md-icon>
</button>

@cesartolosa
Copy link

Ok @EladBezalel, but what about the ripple ink response? The ripple ink boundary seems to be different (out of boundaries) to icon toggles than the regular icon button.

@EladBezalel
Copy link
Member

@cesartolosa #3208

@cesartolosa
Copy link

@EladBezalel, thanks!!!

@thw0rted
Copy link

I know this is super old, but @EladBezalel or others, as far as I can tell there's still no official implementation of "Icon Toggle" from the spec. Yes, you can hack in behavior for a toggle based on mat-icon-button but I'd like to see something as easy to use as mat-checkbox, where toggle state is maintained by the component.

Since icon toggles are in the spec, I would suggest that they should have an example in the docs (and, ideally, easy to use syntax).

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants