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

Latched state for buttons #100

Closed
swervo opened this issue Nov 13, 2015 · 5 comments
Closed

Latched state for buttons #100

swervo opened this issue Nov 13, 2015 · 5 comments
Assignees

Comments

@swervo
Copy link

swervo commented Nov 13, 2015

It would be really useful to have a built-in latched state for buttons particularly for radio button sets or latched button sets. There appears to be a class for this:

.slds-is-selected

but the corresponding stylings don't appear to be present.

There are examples of these here (at the bottom of the page):

https://bootforce.herokuapp.com/

And the CSS I added to make these work is here:

https://github.com/swervo/bootforce/blob/master/app/sass/hacks/_overwrites.scss

@swervo
Copy link
Author

swervo commented Nov 13, 2015

Pull request here:

#101

@stefsullrew
Copy link
Contributor

It looks to me like you want a button group with stateful buttons (buttons that can be toggled on and off and hold their state).

If so, you can view the button-group with icons in the right side of this header:
http://www.lightningdesignsystem.com/components/page-headers#object-home

Does that seem like what you're looking for?

@swervo
Copy link
Author

swervo commented Nov 19, 2015

It's related but not really.

In the simplest terms I'd like to be able to have a simple button that stays down when I click it. At the moment this doesn't seem to be supported by your CSS. There is a class name:

.slds-is-selected

but when this is applied to a simple button it has no effect.

This means I can't easily make a radio button set or a simple latched button set (the icon set is a latched button set - but seems to be specific to the icon button set).

Like I said in my original post there are examples of what I would like to achieve here (at the bottom of the page):

https://bootforce.herokuapp.com/

My PR is only adding selected state styles for the standard buttons. It won't have any impact on anything else.

@kaelig
Copy link
Contributor

kaelig commented Nov 30, 2015

Thanks for the Pull Request, @swervo.

@stefsullrew Should we use aria states such as aria-pressed and aria-selected instead of classes?

aputinski pushed a commit that referenced this issue Mar 3, 2016
@stefsullrew stefsullrew self-assigned this Jun 21, 2016
@stefsullrew
Copy link
Contributor

Hi @swervo - we've added both a radio button and checkbox version of "latched buttons" (meaning, they look like a button-group. You can find them here...

Radio - http://www.lightningdesignsystem.com/components/forms/#flavor-radio-group-alternate
Checkbox - http://www.lightningdesignsystem.com/components/forms/#flavor-checkbox-alternate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants