-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: Start-align Dialog buttons and place the primary button first #1143
feat: Start-align Dialog buttons and place the primary button first #1143
Conversation
Previous description:
|
Hm, this feels a bit off for me because of the 'right is next' convention of LTR languages, but I don't know how strong that convention is. NLS recommends aligning the submit button in a form to the left, to create a natural scan line. Isn't that also relevant here? A dialog is sort of form-like. |
Co-authored-by: Ruben Sibon <[email protected]>
You’re mixing up forms and dialogs here. Forms in dialogs are against our design guidelines. We will only use dialogs for simple confirmations, warnings or information. They will either have 1 button ‘I understand’, or 2, coming down to ‘Yes’ and ‘No’. In these contexts, having the primary action as the first one is logical when reading, listening and focusing. Forms or other flows with multiple steps will be on a regular page and have their own rules for button placement – basically ‘Previous’ aligned to the left and ‘Next’ to the right. |
No, not really. I'm just saying the guidelines on forms seems relevant here as well. Having a single scan line and having the button more visible for users that zoom in seem relevant for this case too.
This probably won't be the button placement, based on the guidelines I linked. Both 'Previous' and 'Next' will be left-aligned. My point is that that same alignment makes sense here imo, and it also makes our overall button alignment more consistent. |
Sorry for my misunderstanding. What change do you suggest for this PR?
That would be fine as well – what I really meant was that form button alignment is out of scope here; shouldn’t have mentioned the explicit example. Let’s discuss that in that future PR. |
I suggest left-aligning the buttons. That way, the primary button is visually more 'anchored', and it has the 2 benefits mentioned in the NLDS guidelines on button placement in forms. |
Ah! Only now I understand what you aimed for with your first comment. Bas did consider this, but decided to follow e.g. this article and right-align buttons in dialog specifically. Have you read the accompanying ticket in Jira? Let’s follow up there or face to face :) |
…:Amsterdam/design-system into feature/DES-553-dialog-buttons-alignment
The conclusion of our research is to put the primary button first in a Dialog while still aligning them to the end of the line. See our ticket in Jira for Bas’ writeup.
I’ve implemented this with CSS that stacks the buttons vertically and stretches them if they don’t fit next to each other – so without a breakpoint 🎉
I documented the guideline as well.