A modal component that captures user attention for critical information or actions.
Dialogs (modals) present important content or interactions that block user interaction with the rest of the page until the user addresses them. Used correctly, they help users focus on critical tasks, decisions, or acknowledgments.
Aspect | Best Practice |
---|---|
Usage | Use dialogs for critical information or actions that must be acknowledged or completed before proceeding. |
Content | Keep the body concise. Aim for 3 lines or fewer to avoid overwhelming users. Do not use asterisks (*) as they can imply hidden details. |
Behavior | Dialogs block interaction with the underlying page until dismissed. They can be configured to close on outside click or require explicit user action. |
Alignment | Left-align headers and body text for clarity and consistency. |
Hierarchy | An overlay beneath the dialog obscures page content, signaling the dialog’s importance. |
Examples | EULA agreements, required forms, or confirmation steps before proceeding. |
Use sentence case for descriptive text, capitalizing only the first word and proper nouns. Apply appropriate punctuation for clarity:
End complete sentences with periods.
Use commas to separate items in lists, compound sentences, introductory phrases, dates, addresses, nonessential clauses, and multiple adjectives.
Spell out numbers one through nine in descriptive text and use numerals for 10 and above.
Examples:
Category | Example |
---|---|
Lists | “The options are red, blue, and green.” |
Compound Sentences | “The button is blue, and the text is white.” |
Introductory Phrases | “With a single click, the user can submit the form.” |
Dates and Addresses | “The meeting is scheduled for Thursday, June 10, 2022, at 10 a.m.” |
Nonessential Clauses | “The user, who is new to the app, may need assistance.” |
Separate Adjectives | “The user-friendly, intuitive interface makes it easy to use.” |
Pauses/Breaks | “The app is designed for people who are looking for an easy way to manage their finances, not for professional accountants.” |
Numbers | “Use three fields,” vs. “Enter 15 items.” |
Overlay Color: Use our background overlay color (#11111) to create a clear separation from the page content behind the dialog.
Dismissal: Provide clear dismissal options (e.g., an “X” close icon, “Accept” or “Decline” buttons) so users know how to proceed or exit.
Accessibility: Refer to Blazor Telerik UI for Blazor Window Documentation | Window Accessibility - Telerik UI for Blazor for ensuring ARIA support and proper focus management.
Psychological Impact:
Task Immersion: The modal’s overlay focuses attention on the current task, reducing distractions.
Urgency and Importance: The full-page overlay conveys that the information or action is important.
Control: Users must address the modal before returning to their previous task, which can be helpful for focus but frustrating if overused.
For technical details and integration guidance:
Dialogs (modals) present important content or interactions that block user interaction with the rest of the page until the user addresses them. Used correctly, they help users focus on critical tasks, decisions, or acknowledgments.
Aspect | Best Practice |
---|---|
Usage | Use dialogs for critical information or actions that must be acknowledged or completed before proceeding. |
Content | Keep the body concise. Aim for 3 lines or fewer to avoid overwhelming users. Do not use asterisks (*) as they can imply hidden details. |
Behavior | Dialogs block interaction with the underlying page until dismissed. They can be configured to close on outside click or require explicit user action. |
Alignment | Left-align headers and body text for clarity and consistency. |
Hierarchy | An overlay beneath the dialog obscures page content, signaling the dialog’s importance. |
Examples | EULA agreements, required forms, or confirmation steps before proceeding. |
Use sentence case for descriptive text, capitalizing only the first word and proper nouns. Apply appropriate punctuation for clarity:
End complete sentences with periods.
Use commas to separate items in lists, compound sentences, introductory phrases, dates, addresses, nonessential clauses, and multiple adjectives.
Spell out numbers one through nine in descriptive text and use numerals for 10 and above.
Examples:
Category | Example |
---|---|
Lists | “The options are red, blue, and green.” |
Compound Sentences | “The button is blue, and the text is white.” |
Introductory Phrases | “With a single click, the user can submit the form.” |
Dates and Addresses | “The meeting is scheduled for Thursday, June 10, 2022, at 10 a.m.” |
Nonessential Clauses | “The user, who is new to the app, may need assistance.” |
Separate Adjectives | “The user-friendly, intuitive interface makes it easy to use.” |
Pauses/Breaks | “The app is designed for people who are looking for an easy way to manage their finances, not for professional accountants.” |
Numbers | “Use three fields,” vs. “Enter 15 items.” |
Overlay Color: Use our background overlay color (#11111) to create a clear separation from the page content behind the dialog.
Dismissal: Provide clear dismissal options (e.g., an “X” close icon, “Accept” or “Decline” buttons) so users know how to proceed or exit.
Accessibility: Refer to Blazor Telerik UI for Blazor Window Documentation | Window Accessibility - Telerik UI for Blazor for ensuring ARIA support and proper focus management.
Psychological Impact:
Task Immersion: The modal’s overlay focuses attention on the current task, reducing distractions.
Urgency and Importance: The full-page overlay conveys that the information or action is important.
Control: Users must address the modal before returning to their previous task, which can be helpful for focus but frustrating if overused.
For technical details and integration guidance:
For more examples, visit the Storybook.
<StudsDialog>
PropsIf true, the dialog will be open by default.
If true, the dialog will be open.
Callback function that is called when the open state changes.
When set to true, interaction with outside elements will be disabled and only dialog content will be visible to screen readers.
<StudsDialogTrigger>
PropsIf true, the trigger will render as a child component.
<StudsDialogPortal>
PropsUsed to force mounting when more control is needed.
The container element to render the dialog into.
<StudsDialogOverlay>
PropsIf true, the overlay will render as a child component.
Used to force mounting when more control is needed.
<StudsDialogContent>
PropsIf true, the content will render as a child component.
If true, the content will always be mounted in the DOM.
Event handler called when focus moves into the component after opening. It can be prevented by calling event.preventDefault.
Event handler called when focus moves to the trigger after closing. It can be prevented by calling event.preventDefault.
Event handler called when the escape key is down. It can be prevented by calling event.preventDefault.
Event handler called when a pointer event occurs outside the bounds of the component. It can be prevented by calling event.preventDefault.
Event handler called when an interaction (pointer or focus event) happens outside the bounds of the component. It can be prevented by calling event.preventDefault.
<StudsDialogClose>
PropsIf true, the close button will render as a child component.
<StudsDialogTitle>
PropsIf true, the title will render as a child component.
<StudsDialogDescription>
PropsIf true, the description will render as a child component.
For more examples, visit the Storybook.
Gets or sets the child content.
Gets or sets the title of the dialog.
Gets or sets a value indicating whether to show the title.
Gets or sets the description of the dialog.
Gets or sets a value indicating whether to show the close button.
Gets or sets the width of the dialog.
Gets or sets the height of the dialog.
Gets or sets the left position of the dialog.
Gets or sets the top position of the dialog.
Gets or sets the bottom position of the dialog.
Gets or sets a value indicating whether the dialog is resizable.
Gets or sets a value indicating whether the dialog is draggable.
Gets or sets the style of the dialog.
Gets or sets the CSS class of the dialog.
Gets or sets the wrapper CSS class of the dialog.
Gets or sets the content CSS class of the dialog.
Gets or sets a value indicating whether to auto-focus the first element in the dialog.
Gets or sets a value indicating whether to close the dialog when the overlay is clicked.
Gets or sets a value indicating whether to close the dialog when the escape key is pressed.
Gets or sets the resize action of the dialog.
Gets or sets the drag action of the dialog.