Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D design
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Primer
  • design
  • Merge requests
  • !442

Update ToggleSwitch images

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mike Perrotti requested to merge mp/toggleswitch-img-updates into main 2 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 1
Compare
  • main (base)

and
  • latest version
    8c85168c
    1 commit, 2 years ago

1 file
+ 15
- 15

    Preferences

    File browser
    Compare changes
content/components/toggle-switch.mdx
+ 15
- 15
  • View file @ 8c85168c

  • Edit in single-file editor

  • Open in Web IDE


@@ -11,7 +11,7 @@ export default ComponentLayout
## Anatomy
![Diagram of toggle switch with its parts labeled](https://user-images.githubusercontent.com/2313998/159750870-0b575598-53f5-4215-9fb0-2ba078183dda.png)
![Diagram of toggle switch with its parts labeled](https://user-images.githubusercontent.com/2313998/226448730-9e4233ec-feff-4982-acce-9aa8ca5beac2.png)
- **Track**: The clickable area where the toggle switch moves back and forth
- **Knob**: Changes color and position depending on whether the switch is on or off
@@ -41,7 +41,7 @@ export default ComponentLayout
<img
width="456"
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587115-5ffcdefb-f5e9-4180-8dc3-5328b0440f7f.png"
src="https://user-images.githubusercontent.com/2313998/226448731-96a9bc7d-6c4f-4f30-8e32-ff73d0a76474.png"
/>
</Box>
@@ -49,14 +49,14 @@ export default ComponentLayout
<Do>
<img
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587088-99e8fe4c-59a3-4452-836d-bd6f2297045a.png"
src="https://user-images.githubusercontent.com/2313998/226448719-fd65a0ea-bbfb-4b53-a00d-2ca0db8f0991.png"
/>
<Caption>Use succinct phrases with verbs or nouns</Caption>
</Do>
<Dont>
<img
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587096-5f8a6913-df95-4ea0-9838-a366faf95e52.png"
src="https://user-images.githubusercontent.com/2313998/226448723-86d146d8-1a92-4506-8a5e-106a8bc0b8a7.png"
/>
<Caption>Don't use phrases that describe the switch's state</Caption>
</Dont>
@@ -85,12 +85,12 @@ export default ComponentLayout
<img
width="456"
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587115-5ffcdefb-f5e9-4180-8dc3-5328b0440f7f.png"
src="https://user-images.githubusercontent.com/2313998/226448731-96a9bc7d-6c4f-4f30-8e32-ff73d0a76474.png"
/>
<img
width="456"
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587126-8d30ff26-33a8-4b84-87db-13dcfdff9dac.png"
src="https://user-images.githubusercontent.com/2313998/226448741-72a264f6-3269-4d09-8afe-75042a189a54.png"
/>
</Box>
</Box>
@@ -110,7 +110,7 @@ export default ComponentLayout
<img
width="456"
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587124-e7ef0a16-fd42-4614-be3e-80c985332ef7.png"
src="https://user-images.githubusercontent.com/2313998/226448738-1dff6c1c-eac3-4a0a-850e-02d579272a11.png"
/>
</Box>
@@ -130,7 +130,7 @@ export default ComponentLayout
<img
width="456"
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587116-aa07a847-a633-4515-82b3-20ebe2349914.png"
src="https://user-images.githubusercontent.com/2313998/226448735-1e9f8d24-a084-4cee-ae59-fbabce944d7a.png"
/>
</Box>
@@ -151,7 +151,7 @@ export default ComponentLayout
<img
width="456"
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159591632-f604ec1d-aca9-42f7-ad65-16f8811f192f.png"
src="https://user-images.githubusercontent.com/2313998/226448736-db898a3c-8b68-4e5e-a4e8-ad1f6d549062.png"
/>
</Box>
@@ -165,7 +165,7 @@ Toggle switches should have the same keyboard navigation features as a button. A
When the UI is rendered on a touch-screen device, ensure that the toggle switch has a large enough touch target size. The toggle switch should respond to hovers, clicks, and taps anywhere in the touch target area, even if it isn't directly on the control.
![Diagram showing touch target size on medium and small toggle switches](https://user-images.githubusercontent.com/2313998/159587125-7b4c5f1a-2cdb-4653-8650-6c94d78e951d.png)
![Diagram showing touch target size on medium and small toggle switches](https://user-images.githubusercontent.com/2313998/226448740-1506ddb5-3cdb-4aef-9a3b-0d66839e7d11.png)
## Mixed values
@@ -173,20 +173,20 @@ Since a toggle switch can only be "on" or "off", it could be confusing to use a
If you have a group of configuration options that can be disabled, use a button instead of a toggle switch. Disabling the group turns off all configuration options, but remembers their previous state when the user wants to turn that section back on. While the section is disabled, the configuration options are hidden.
![Configuration options section that can be enabled or disabled. Configuration controls are hidden when it is disabled.](https://user-images.githubusercontent.com/2313998/159587120-2d842830-18c7-4429-bd10-f5424f6fac9e.png)
![Configuration options section that can be enabled or disabled. Configuration controls are hidden when it is disabled.](https://user-images.githubusercontent.com/2313998/226448737-ed98e831-ecbc-476e-809a-6799bf73a5f7.png)
<DoDontContainer>
<Do>
<img
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587100-1a1af5b2-dd19-456a-a0ed-c2f9fa7f7c2e.png"
src="https://user-images.githubusercontent.com/2313998/226448725-d7cb6db8-9738-4097-89f4-9279fec7400a.png"
/>
<Caption>Use a button to affect multiple related toggles</Caption>
</Do>
<Dont>
<img
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587101-446548c2-41c3-45c1-b710-db3149e2ebe4.png"
src="https://user-images.githubusercontent.com/2313998/226448727-20d008fa-866b-4c6d-849a-81941e5d09eb.png"
/>
<Caption>Don't use a toggle switch to represent mixed values</Caption>
</Dont>
@@ -203,14 +203,14 @@ A toggle switch should never be used as a replacement for a checkbox. See [savin
<Do>
<img
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587105-45d50974-eb76-46cd-a3fd-c1e0f605f3ef.png"
src="https://user-images.githubusercontent.com/2313998/226448728-73c5ca2d-82c4-4d8a-b043-d200dff3ae16.png"
/>
<Caption>Use a toggle switch like a button</Caption>
</Do>
<Dont>
<img
role="presentation"
src="https://user-images.githubusercontent.com/2313998/159587113-6c8461f7-3d4d-4e6a-b3a5-c585c5143fba.png"
src="https://user-images.githubusercontent.com/2313998/226448729-46e2b1e1-61ed-4773-bdba-29f7c0174052.png"
/>
<Caption>Don't use a toggle switch as a replacement for a checkbox</Caption>
</Dont>
0 Assignees
None
Assign to
2 Reviewers
Katie Langerman's avatar
Katie Langerman
Emily Brick's avatar
Emily Brick
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
5
5 participants
Emily Brick
Katie Langerman
Administrator
Mike Perrotti
Ghost User
Reference: primer/design!442
Source branch: mp/toggleswitch-img-updates

Menu

Explore Projects Groups Snippets