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

ux-radio #21

Closed
Vheissu opened this issue Nov 24, 2016 · 8 comments
Closed

ux-radio #21

Vheissu opened this issue Nov 24, 2016 · 8 comments

Comments

@Vheissu
Copy link
Member

Vheissu commented Nov 24, 2016

Implement the ux-radio component for Material and iOS design.

@Vheissu
Copy link
Member Author

Vheissu commented Nov 24, 2016

I'll take this one @EisenbergEffect if you can assign it to me.

@groundzero2010
Copy link

I'd like to help out with this.

@serifine serifine removed their assignment Apr 11, 2017
@serifine
Copy link
Contributor

Go for it!

@jdanyow
Copy link
Contributor

jdanyow commented Apr 12, 2017

some ideas in this gist: https://gist.run/?id=a78d15898660218b8438e34dcc31f390

@serifine
Copy link
Contributor

So perhaps two components, one for a simple use case, one for a more complex one.

Single Radio component for simple use cases

<ux-radio value="male" checked.bind="gender">Male</ux-radio>

@jdanyow multi input idea that could wrap up the original.

<ux-radio-group items-source.bind="colors" value.bind="color1"></ux-radio-group>

Thoughts?

@serifine
Copy link
Contributor

I will leave this here as well, from an earlier discussion on gitter.

To expand on what I copied below, the ux-checkbox currently will have the same bindings for the value and checked.bind, so perhaps we could have a single wrapper for both components since the binding and styles will be close if not the same.


So the standard use of a radio button is:

  <input type="radio" name="color" value="red"> Red
  <input type="radio" name="color" value="blue"> Blue

I think there is a good game plan going forward with the following attributes:
value: represents the value of the radio button, follows the standard html usage of value in a checkbox
checked: represents the property on the view model to bind to, follows how Aurelia binds to radios in the docs
label(optional): represents an optional label that can also be provided in the slot

Leaving the following usage

  <ux-radio value="red" checked.bind="color"></ux-radio>
  <ux-radio value="blue" checked.bind="color"></ux-radio>

  <ux-radio value="red" checked.bind="color">Red</ux-radio>
  <ux-radio value="blue" checked.bind="color">Blue</ux-radio>

  <ux-radio value="red" checked.bind="color" label="Red"></ux-radio>
  <ux-radio value="blue" checked.bind="color" label="Blue"></ux-radio>

@jdanyow
Copy link
Contributor

jdanyow commented Apr 13, 2017

@ZHollingshead re: #21 (comment)

two components: the radio primitive and the radio group/selector- sounds good 👍

@serifine serifine closed this as completed Sep 1, 2017
@serifine
Copy link
Contributor

serifine commented Sep 1, 2017

Issue moved to aurelia/ux-components #13 via ZenHub

@serifine serifine reopened this Oct 6, 2017
@serifine serifine added this to the 0.5.0 milestone Nov 1, 2017
@serifine serifine self-assigned this Nov 10, 2017
@serifine serifine removed this from the 0.5.0 milestone Nov 23, 2017
@serifine serifine closed this as completed Nov 7, 2018
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

5 participants