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
The toggle/swtich component is used to activate or deactivate an element. Uses a visual metaphor that is know to the user with visible differences between on and off state.
11
+
The toggle/switch is meant to resemble a physical switch and allow a user to turn a setting “on” or “off”. It should be used to switch between two states/modes: active or inactive.
12
12
{: .docs-intro}
13
13
14
-
It is recommended to always display the toggle with a label above it as well as the label of the selected state. For example, the label above would be Active, the toggle state would be "on" and the selected state label displayed to the right of the toggle would be "Yes".
14
+
It is recommended to always display the toggle with a label above it as well as the label of the selected state. For example, the label above would be Active, the toggle state would be “on” and the selected state label displayed to the right of the toggle would be “Yes”.
15
15
16
-
<br>
17
16
18
-
## Toggle Options
19
-
In addition to the default option, there are two additional modifiers avialable:
20
-
-`fd-toggle--label`: renders `off` and `on` labels inside the toggle switch
21
-
-`fd-toggle--semantic`: renders semnatic colors and icons inside the toggle switch
22
-
23
-
> Note: `fd-toggle--label` modifier only supports up to three characters by default. The width of the component will not increase to accomodate longer labels and will need to be a css override, for example - `<span class="fd-toggle" style="width: 70px">`
17
+
## Toggle with Label on top
18
+
To clarify the meaning of the toggle, use a label above it (ex. Live).
When the value of the toggle requires translation, it is suggested to display the text value (ex. On/Off) outside and to the right of of the toggle to allow for longer translations. (ex. French translation of “On” is “Allumez”)
@@ -54,7 +88,7 @@ In addition to the default option, there are two additional modifiers avialable:
54
88
55
89
56
90
## Compact Mode
57
-
`fd-toggle--compact` modifier can be used to render the compact size of the toggle `--label` and `--semantic` options are also avialable with the `compact` mode.
91
+
`fd-toggle--compact` modifier can be used to render the compact size of the toggle
58
92
{% capture default %}
59
93
<label>
60
94
<span class="fd-toggle fd-toggle--compact">
@@ -63,16 +97,6 @@ In addition to the default option, there are two additional modifiers avialable:
@@ -90,7 +114,7 @@ In addition to the default option, there are two additional modifiers avialable:
90
114
91
115
In addition to `default` and `--compact`, the toggle can be set to 3 sizes: `--xs`, `--s` and `--l`. When used with forms, it is recommended to use the small size so that form components will be consistent.
92
116
93
-
> Node: `--label` and `--semantic`modifiers are currently not supported by these optional sizes
117
+
> Node: `--semantic`modifier is currently not supported by these optional sizes
0 commit comments