-
Notifications
You must be signed in to change notification settings - Fork 147
Design guidelines: Form and form control #5047
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
Open
kaylachumley
wants to merge
9
commits into
main
Choose a base branch
from
form-guidelines
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,385
−1,205
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
12db9ce
Add best practices section to form design guidelines
kaylachumley 9b7e458
Update form-control design guidelines with pf-m-form usage note
kaylachumley 9a6ce88
Merge branch 'main' into form-guidelines
kaylachumley 74a04ae
Update design guidelines images and spacing token references
kaylachumley bb34d00
Refine border radius token references in form best practices section
kaylachumley 998c931
Fix blurry images by correcting file extensions from .svg to .png
kaylachumley 5aa4338
Replace raster images with true SVGs for form design guidelines
kaylachumley 1550763
Update checkbox-nested.svg
kaylachumley c22ca21
Update SVG images for checkbox and form design guidelines
kaylachumley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,13 +10,13 @@ import '../components.css'; | |
| Checkboxes allow users to choose **1 or more items** from a list of options. | ||
|
|
||
| <div class="ws-docs-content-img"> | ||
|  | ||
|  | ||
| </div> | ||
|
|
||
| You can also use a single checkbox to allow a user to enable or disable a feature or setting, along with a save button. | ||
|
|
||
| <div class="ws-docs-content-img"> | ||
|  | ||
|  | ||
| </div> | ||
|
|
||
| ### When to use | ||
|
|
@@ -32,13 +32,13 @@ Checkbox labels fall to the right of the checkbox control. If placed vertically, | |
| You can use headings to label a group of checkboxes. The placement of headings will depend on the layout of other content in the form or on the page you’re designing. For more information on how to arrange checkboxes, see our [forms documentation](/components/forms/form/design-guidelines). | ||
|
|
||
| <div class="ws-docs-content-img"> | ||
|  | ||
|  | ||
| </div> | ||
|
|
||
| You also have the option to use progressive disclosure by nesting other controls underneath a checkbox. The nested options would be enabled or disabled when the user selects or deselects a checkbox. | ||
|
|
||
| <div class="ws-docs-content-img"> | ||
|  | ||
|  | ||
| </div> | ||
|
|
||
| ### When to use switches vs. checkboxes | ||
|
|
@@ -47,20 +47,20 @@ The main difference between a switch and a checkbox is that a switch changes an | |
| * Use checkboxes when the options do not save automatically and require the user to perform an additional action to save changes (in this case, pressing the “Save changes” button). | ||
|
|
||
| <div class="ws-docs-content-img"> | ||
|  | ||
|  | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should you remove the "Save changes" button from the one with switches? |
||
| </div> | ||
|
|
||
|
|
||
| * Use a switch for situations where you are turning a series of one or more independent options on or off. | ||
|
|
||
| <div class="ws-docs-content-img"> | ||
|  | ||
|  | ||
| </div> | ||
|
|
||
| * Use checkboxes when you may have an indeterminate state where you can select all, none, or some actions. | ||
|
|
||
| <div class="ws-docs-content-img"> | ||
|  | ||
|  | ||
| </div> | ||
|
|
||
| ## Accessibility | ||
|
|
||
Binary file added
BIN
+9.07 KB
...mentation-site/patternfly-docs/content/components/checkbox/img/CB-alignment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 0 additions & 32 deletions
32
...mentation-site/patternfly-docs/content/components/checkbox/img/CB-alignment.svg
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+8.48 KB
...ocumentation-site/patternfly-docs/content/components/checkbox/img/CB-nested.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 0 additions & 26 deletions
26
...ocumentation-site/patternfly-docs/content/components/checkbox/img/CB-nested.svg
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+4.64 KB
...ntation-site/patternfly-docs/content/components/checkbox/img/CB-usage-multi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 0 additions & 19 deletions
19
...ntation-site/patternfly-docs/content/components/checkbox/img/CB-usage-multi.svg
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+1.44 KB
...tation-site/patternfly-docs/content/components/checkbox/img/CB-usage-single.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.1 KB
...ntation-site/patternfly-docs/content/components/checkbox/img/CB-vs-switch-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...ntation-site/patternfly-docs/content/components/checkbox/img/CB-vs-switch-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.2 KB
...ntation-site/patternfly-docs/content/components/checkbox/img/CB-vs-switch-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions
32
...ion-site/patternfly-docs/content/components/checkbox/img/checkbox-alignment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
...tation-site/patternfly-docs/content/components/checkbox/img/checkbox-nested.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions
19
...n-site/patternfly-docs/content/components/checkbox/img/checkbox-usage-multi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...mponents/checkbox/img/CB-usage-single.svg → ...ts/checkbox/img/checkbox-usage-single.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the form docs for progressive disclosure, we use the language "hide and show", which I think is more clear than enabled/disabled since enable/disable has special meaning when it comes to form fields.