Content in modal window
Description of the component for modal windows can be found in the Modal.
Here we have compiled recommendations for content styles in modal windows.
|16px to a text (
|24px to controls and inputs (
|For confirm modals use small margin of 8px (
|Margin between the content and CTA buttons is 24px (
|For confirm modals margin between the content and CTA buttons is 16px (
Title and text
- For title in confirm windows use text with 20px size (
--lh-400). For title in all other window types use text with 24px size (
- For blocks of text use 16px size (
-lh-300tokens). Avoid using font-size less than 16px for blocks of text that user needs to read. Use 14px font-size carefully, and always check it's readability and contrast against background.
Modal windows must include a Call-to-Action (CTA) or main button. While the "Cancel" button and "Close" icon are optional, they are recommended.
We also advise using controls with a large (L) size within modal windows.
Notices should be positioned next to the element that triggers the alert. For instance, if a user attempts to submit a project title and encounters an error, the notice should be placed before the buttons.
Dual-zone modal window
For dual-zone modal window use:
Fixed header and footer
When scrolling the modal's content area, the fixed areas acquire shadows from the top and bottom sides. Maintain moderate padding inside the fixed areas (for example, 8px).
While content inside the modal window is loading or reloading, display the Spin overlay on top of the content.
- Use the largest Spin size – XXL.
- Ensure the spinner is centered relative to the hidden content.
- Including a message for this state is optional.
In most cases, we recommend you aligning the content, titles, and controls of modal windows to the left.
However, exceptions may arise where, according to the composition, both the header and controls should be centered within the modal window.
Align content to the left when:
- Content includes lists and large texts (left alignment enhances readability).
- Forms feature inputs of varying lengths.
- Modal windows are divided into multiple logical sections (for example, wizards, dual-zone windows with previews, and a separate filter section).
- Content includes different types of content: form, lists, tables, etc.
- Fixed controls are present.
Align content to the center when:
- Modal window displays success notifications containing illustrations.
- Modal window includes a notification with single main button or buttons for scrolling through content.