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

Switch component #194

Closed
antictor opened this issue Aug 2, 2019 · 4 comments
Closed

Switch component #194

antictor opened this issue Aug 2, 2019 · 4 comments
Assignees
Labels
Type: Enhancement New feature or request

Comments

@antictor
Copy link
Contributor

antictor commented Aug 2, 2019

The switch component is a form component used to record a selection from a number of values. With regards to behaviour, a switch can be thought of like a radio field, allowing a single choice from a small number of options. The different between a switch and radio is presentation, a switch looks similar to a button group.

Screenshot 2019-08-02 at 16 32 33

A switch should use markup for a field group, complete with legend to act as the label for the range of options.

The switch will need to be compatible with Formik.

Not sure how a switch should present on mobile, this depends how inputs should size. Should they go full width?

@hxltrhuxze
Copy link
Contributor

The Switch Component

The Switch component has 3 states - unselected, hovered, and selected.

  • By default, there is always one item that has the selected state.
  • Hovering on an item will add a small blue border to it.
  • Clicking it will deselect the currently active item and add the Selected state to the item clicked.

Screenshot 2019-08-08 at 16 20 30

Mobile

As we have limited screen real estate on mobile, changing the Switch to a Select seems most appropriate here. Vertically stacking the selection could be one option, however this will take up a significant amount of room.

Screenshot 2019-08-08 at 16 24 11


Changes from original design

  • Changed the overall style of the Switch to distance itself from a button group/button. As these have different effects for the user, we want to keep them visually separate.

@09txzS1qs
Copy link
Contributor

The difference between Hover and Selected is quite subtle in terms of border width. I wonder if the hover could be lower contrast and the selected could have a slightly larger border and higher contrast?

@m7kvqbe1
Copy link
Member

m7kvqbe1 commented Sep 2, 2019

This is now in active development.

@m7kvqbe1 m7kvqbe1 mentioned this issue Sep 9, 2019
10 tasks
@m7kvqbe1
Copy link
Member

m7kvqbe1 commented Sep 9, 2019

WIP @ #266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants