Skip to content

Design guidelines: Form and form control - #5047

Merged
kaylachumley merged 24 commits into
mainfrom
form-guidelines
Jul 22, 2026
Merged

Design guidelines: Form and form control #5047
kaylachumley merged 24 commits into
mainfrom
form-guidelines

Conversation

@kaylachumley

@kaylachumley kaylachumley commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

closes #5052

Changes

  • Added a Best practices section to the form design guidelines with a "Menu toggles and dropdowns in a form" subsection documenting the pf-m-form modifier
  • Added pf-m-form usage note to the form-control design guidelines
  • Updated spacing references in the form design guidelines to use design tokens (--pf-t--global--spacer--lg, --pf-t--global--spacer--md)
  • Replaced design guidelines images for the form, form-control, checkbox, radio, and text-input components

Adds a new "Best practices" section with a "Menu toggles and dropdowns in a form" subsection, documenting the use of the pf-m-form modifier and its effect on border radius across themes. Includes a do/don't example image.
@kaylachumley kaylachumley changed the title Updat to Form and form control guidelines Updat to Form and form control design guidelines Jun 30, 2026
@patternfly-build

patternfly-build commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Preview: https://pf-org--pr-5047-site.surge.sh

@kaylachumley kaylachumley changed the title Updat to Form and form control design guidelines Update to Form and form control design guidelines Jul 9, 2026
@kaylachumley kaylachumley changed the title Update to Form and form control design guidelines Design guidelines: Form and form control Jul 9, 2026
Comment thread packages/documentation-site/patternfly-docs/content/components/form/forms.md Outdated
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploying patternfly-org with  Cloudflare Pages  Cloudflare Pages

Latest commit: e7d23d5
Status:🚫  Build failed.

View logs

- Replace design guidelines images for form, form-control, checkbox, radio, and text-input
- Update spacing references in form design guidelines to use token values (--pf-t--global--spacer--lg, --pf-t--global--spacer--md)

@kaylachumley kaylachumley left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updates all of the forms and form related design guidelines images

Swaps PNG placeholders for actual SVG files across form, form-control,
checkbox, radio, and text-input design guidelines to fix blurry images.
Updates markdown references to match new SVG filenames.
![Do and don't example showing a menu toggle with the pf-m-form modifier applied (square corners) versus without it (pill shape) in a form context.](./img/form-toggle-modifier.svg)
</div>

In the default PatternFly theme, form elements use `--pf-t--global--border--radius--control--form-element` (6px) border radius token. In the [Felt theme](/foundations-and-styles/theming#project-felt-theme), form elements, including input fields, menu toggles, and dropdowns, continue to use the same `--pf-t--global--border--radius--control--form-element` (6px) token, while other non-control components use `--pf-t--global--border--radius--control--default`. Using the `pf-m-form` class ensures that your form elements and menu toggle always match the border radius of the surrounding form fields, regardless of theme.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this update @kaylachumley

@andrew-ronaldson andrew-ronaldson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but waiting on feedback about the react props.

@mcoker
mcoker requested a review from thatblindgeye July 16, 2026 18:15

@mcoker mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, some are pretty nitpicky so feel free to pick and choose what you think is worth updating. Nothing here is blocking.

One thing though - it looks like this PR is adding a .png file for most/all of the SVGs - was that intended to be checked in? The images on the site are all still using the .svg - none of the markdown docs pages were updated to reference the new .png files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alignment is a little off. There is a 4.5px top padding in the component

Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the padding off in the react component or off in the design guidelines image? I have no 4.5px top padding in figma. Trying to figure out which is correct? @mcoker @andrew-ronaldson

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry that top padding is present in the react component but not in the screenshot in this PR (from figma, I'm guessing?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I think I asked my question wrong! I know that the react has the top padding but i wasnt sure if the top padding is supposed to be there in general? Wondering if the figma implementation with no top padding is correct or if the top padding in the react component is the correct implementation and I need to update the figma component to match? @mcoker

@mcoker mcoker Jul 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you asked correctly, I misread 😅 AFAIK the spacing hasn't changed, it's been like that for as far back as I remember. It's to better align the label with a text input/menu toggle (when the label is next to a box that has a border, top padding, and text in it). We have a variant for form labels that removes the top padding when the label is used with checkboxes or elements where the padding doesn't make as much sense - https://www.patternfly.org/components/forms/form#horizontal-stacked-no-padding-top

That said, the padding looked a lot better in PF5 - the label text was better aligned with the input text beside it.

Screenshot 2026-07-21 at 2 48 26 PM

Does make me wonder if we should update that either to remove the padding like in figma, or update the label padding so it centers better with the text in form inputs beside the label like it did in PF5. Forms are everywhere so it would have a fairly big impact if we changed it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh okay thanks for the background context! @andrew-ronaldson @lboehling thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcoker we can make a design issue to look at the alignment again. I'm okay merging this with that follow up in mind

Comment thread packages/documentation-site/patternfly-docs/content/components/form/forms.md Outdated
Comment thread packages/documentation-site/patternfly-docs/content/components/form/forms.md Outdated
Comment thread packages/documentation-site/patternfly-docs/content/components/form/forms.md Outdated
Comment thread packages/documentation-site/patternfly-docs/content/components/form/forms.md Outdated
Comment thread packages/documentation-site/patternfly-docs/content/components/form/forms.md Outdated
kaylachumley and others added 4 commits July 17, 2026 13:04
…/checkbox/checkbox.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
…/checkbox/checkbox.md

Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
…/form/forms.md

Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
…/form-control/form-control.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
kaylachumley and others added 11 commits July 17, 2026 13:28
…/form-control/form-control.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
…/form-control/form-control.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
…/checkbox/checkbox.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
…/checkbox/checkbox.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
…/checkbox/checkbox.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
…/checkbox/checkbox.md

Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
- Delete unreferenced PNG duplicates from checkbox, form-control, form, radio, and text-input img folders
- Update general spacing token to --pf-t--global--spacer--gap--group-to-group--vertical--default
- Update button spacing token to --pf-t--global--spacer--gap--action-to-action--default
- Add xl spacer reference for form-to-button-group spacing
- Rename section to "Menu toggles in a form" and update pf-m-form description to mention isForm prop

@andrew-ronaldson andrew-ronaldson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make a design follow up to look at the label inconsistencies from Figma and react

@kaylachumley
kaylachumley merged commit 8d3ce27 into main Jul 22, 2026
5 of 7 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/ast-helpers@1.4.0-alpha.394
  • @patternfly/documentation-framework@6.49.2

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Design Guidelines for Form Control Elements (Square vs Pilled)

5 participants