What is the best way to set up buttons configuration for the Modus Modal Web component #12
-
The latest Modus guidelines(Figma) for Modals state that a component's footer can have up to three buttons, as long as they follow a structural or colour progression without mixing. Non-primary buttons can also repeat. We need a configuration on the Modal component to let users choose which buttons to render and ensure the conditions are met. Even if we cannot apply all the conditions mentioned above, we must at least identify the primary button and enforce its position. A primary button always stays right. Examples, ValidInvalid:The worst-case scenario is that we end up with a simple array of three buttons, with no conditions. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
@mihkeleidast Thank you for the answer. Very much appreciated! The Modus Web components are designed with the Modus Styleguide in mind, ensuring consistency across Trimble products and preventing projects from deviating from the guidelines. The components have limited user control to maintain this consistency, as tiger teams validate multiple use cases before framing the guidelines. However, we will provide more flexibility to the components as new valid use cases arise and the components need support. For example, inside a Modal the buttons are expected to be on the right side, not on the left. For more questions on the UX, you can reach out to Ewa Nowak/Eric Gunther/Sonia Kaukonen. |
Beta Was this translation helpful? Give feedback.
-
Given the rigidity that is desired, there will be design decisions that don't make as much sense as a more flexible system would. Normally you'd either have a slot or an array of buttons. Both options allow for modus to design system to be broken, or to at least add confusion with something isn't rendered. This leads me to think that the answer is to add a tertiaryButton option or have secondary1 and secondary2. Its odd, but I think that comes with the territory here. Then you could at least have a single property that defines the type of both secondary buttons. My preference would be for a more flexible component library and expect that UX teams to follow the modus design system while constructing their UI's and presenting to development to build. This would simplify and potentially speed up the development of the components too. However that can and will be abused when the modus design system doesn't cover their use case perfectly. |
Beta Was this translation helpful? Give feedback.
-
@cjwinsor @mihkeleidast I am thinking of having it like an array of buttons, each with an index and a flag to indicate whether or not a primary button so that we can control the position of that button alone. |
Beta Was this translation helpful? Give feedback.
-
@cjwinsor @mihkeleidast Thank you for all your inputs 👍🏼 The Modus team reviewed it and confirmed that we could let users configure the footer. So we will add a slot for the footer but will keep the primary and secondary buttons configurations, using which we can retain the focus inside the Modal window until a close event occurs. There will be a separate Github issue for wrapping the focus with a custom footer. |
Beta Was this translation helpful? Give feedback.
@cjwinsor @mihkeleidast Thank you for all your inputs 👍🏼 The Modus team reviewed it and confirmed that we could let users configure the footer. So we will add a slot for the footer but will keep the primary and secondary buttons configurations, using which we can retain the focus inside the Modal window until a close event occurs. There will be a separate Github issue for wrapping the focus with a custom footer.