You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guidelines/components/switch/README.md
+69-57Lines changed: 69 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,73 +3,93 @@
3
3
Switch toggles are elements that can get two simple states, each of them has an impact on the system and it can be switched on or off, there are no more options.
4
4
If the switch toggle is on one state, the action to change it will modify to value of the element to the contrary.
5
5
6
-
The main difference to using a switch toggle instead of other components with a similar purpose like radio buttons or checkboxes are the immediate effect that they should take. This grants the users control on the application, changing preferences and configuration settings.
6
+
## Usage
7
7
8
-
With the use of switch toggle, it is not needed a submit button to do the appropriate action, because the action takes place at the moment that the switch is turned on or off.
8
+
- Switch toggles should be used in place of radio buttons whenever the options are opposites of each other (i.e. yes/no, on/off, etc).
9
+
- Whenever is possible stack the switch component vertically.
10
+
- Switches have immediate effect over the application, changing preferences and configuration settings. Don't use a submit button.
11
+
12
+
## States
9
13
10
-
## Appereance
14
+
Five different states are defined in the life cycle of the component: **unselected enabled**, **unselected focus**, **unselected disabled**, **selected enabled**, **selected focus** and **selected disabled**
11
15
12
-
The appearance of the component should provide good visual feedback, making clear when the switch is on or off. To make a difference between states colors, shadows and fill properties can be used.
A label can be linked with the component to indicate what action will perform when the change occurs. It should be descriptive and clear about what the component is doing or affecting.
18
+
_Switch component states_
15
19
16
-
## Modes
20
+
## Anatomy
17
21
18
-
Two main modes are represented within the component.
In some application the use of several switches based on the requirements could appear, that why we provide some indications in the case that the user needs to use stacked switches.
35
+
36
+
## Label position
25
37
26
-
Five different states are defined in the life cycle of the component: **normal**, **disabled**, **hovered** and **focused**.
38
+

In some application the use of several switches based on the requirments could appear, that why we provide some indications in the case that the user needs to use stacked or linear switches.
53
+
_Switch design specifications_
51
54
52
-
### Linear
53
55
54
-
The text should have a margin of 16 pixels based on its position. If the text is after the switch, it should define the margin on the right side. Otherwise, if the label of the switch is before the component, the margin has to go on the left side.
56
+
### Color
55
57
56
-

58
+
| Component token | Element | Core token | Value |
0 commit comments