Modal
This modal cannot be dismissed by clicking outside, pressing Escape, or the close button.
You must use the button below to close it.
certara-modal
Section titled “certara-modal”Component for modal and dialog content
Properties
Section titled “Properties”bodyClassName
| Attribute | body-class-name |
| Type | string |
| Default | undefined |
| Required | false |
| Description | Adds optional classes to the modal body container |
centered
| Attribute | centered |
| Type | boolean |
| Default | false |
| Required | false |
| Description | Boolean value to center the modal vertically in the view port. If false, the modal will appear at the top of the screen. |
closeDisabled
| Attribute | close-disabled |
| Type | boolean |
| Default | false |
| Required | false |
| Description | If true, close button is hidden. Modal cannot be dismissed by clicking outside or escape key. |
The modal can only be closed by setting open to false with a function call. |
closeOnClickOutside
| Attribute | close-on-click-outside |
| Type | boolean |
| Default | false |
| Required | false |
| Description | If true, close the modal when the user clicks on the backdrop |
footerClassName
| Attribute | footer-class-name |
| Type | string |
| Default | undefined |
| Required | false |
| Description | Adds optional classes to the modal footer container |
headerClassName
| Attribute | header-class-name |
| Type | string |
| Default | undefined |
| Required | false |
| Description | Adds optional classes to the modal header slot, if used, for instance to change padding or background color |
heading
| Attribute | heading |
| Type | string |
| Default | undefined |
| Required | false |
| Description | The text to display in the heading of the modal DEPRECATED. Use headline instead. Will be removed in the next major version. |
headline
| Attribute | headline |
| Type | string |
| Default | undefined |
| Required | false |
| Description | The text to display in the headline of the modal |
modeless
| Attribute | modeless |
| Type | boolean |
| Default | false |
| Required | false |
| Description | Will set modal to modeless, allowing interaction with the rest of the page and remvoing the backdrop. |
open
| Attribute | open |
| Type | boolean |
| Default | false |
| Required | false |
| Description | Boolean value to open and close the modal. If true, the modal will appear, if false, the modal will hide. |
placement
| Attribute | placement |
| Type | "left" | "right" |
| Default | undefined |
| Required | false |
| Description | Anchor placement of modal only when sidebar=‘true’. Valid values are ‘left’ and ‘right’. Defaults to left. |
position
| Attribute | position |
| Type | "left" | "right" |
| Default | undefined |
| Required | false |
| Description | Anchor position of modal only when sidebar=‘true’. Valid values are ‘left’ and ‘right’ (default is ‘left’). DEPRECATED. Use placement instead. Will be removed in the next major version. |
scrollable
| Attribute | scrollable |
| Type | boolean |
| Default | false |
| Required | false |
| Description | If true, the body of the modal will be scrollable if the contents reach overflow. If false, the entire modal, including header and footer will be scrollable if the content reaches overflow. |
sidebar
| Attribute | sidebar |
| Type | boolean |
| Default | false |
| Required | false |
| Description | If true, this will render the modal appearing as an anchored sidebar (default anchor position is left of viewport) |
size
| Attribute | size |
| Type | "fullscreen" | "lg" | "md" | "sm" | "xl" |
| Default | 'md' |
| Required | false |
| Description | The size of the modal |
Events
Section titled “Events”| Name | Description | Bubbles |
|---|---|---|
certaraClose | Fired when the modal is closed via the close button, or the escape key. | true |
Methods
Section titled “Methods”There are no public methods available for this component
| Name | Description |
|---|---|
body | Slot for the modal body content |
footer | Slot for the footer content, typically action buttons |
header | Slot for the modal header content. Use this if you need more custom content in the heading. If you just need a title, use the headline attribute. |
Modals are overlays that temporarily block the main view of the application. They are used for confirming actions, selecting options, managing items, and previewing information.
Design guidelines
Section titled “Design guidelines” In practice
Section titled “In practice”Modals can be incorporated when users are required to make choices or enter information to continue with their current task. They can be helpful in breaking up complex workflows that involve multiple steps.
The three main parts that make up a modal are:
- Header - displays the title and the close icon.
- Body - contains the main content which could be text only or a combination of different interactive elements. The body area is scrollable if the content exceeds the height of the modal.
- Footer - can show actions and links as needed.
Limit footer options
The modal component allows for up to three options in the footer (primary, secondary, tertiary). We advise limiting it to one or two options. A third option may be unavoidable at times, but should be used sparingly.
Avoid multiple modals
Showing more than one modal at a time is overwhelming and confusing for users. If necessary, use a progressive modal in cases where the user can navigate forward and backward through sequential modal content.
Size considerations
The design system includes four modal sizes (S, M, L, XL). Choosing the appropriate size for your design is about balancing the amount of content to enhance readability.
For example, with shorter content, use a small modal to avoid long single lines. With longer content, you’ll want to use a larger modal to reduce scrolling.
Types of modals
Section titled “Types of modals”Confirmation modal
These modals ask for explicit user confirmation for actions that may have significant consequences. They help prevent accidental changes or data loss. The user must choose an action to proceed.
Information modal
Displays additional information or instructions within a page context. Does not require user action.
Settings modal
Lets the user select or update system settings and other options. Selection/builder modal
Allows the user to select from a list of records to add, remove, or link together in some way. Can include search.
Form modal
Presents a form within a focused workflow, allowing the user to fill out and submit information.
Progressive modal
Made up of multiple, sequential steps that guide the user through a task.
Full-page modal
Used for complex workflows that require larger page real estate and focused engagement.
Accessibility
Section titled “Accessibility”- Modals should be operable using the keyboard alone.
- Focus should remain and cycle through an open modal until it is dismissed.
- Aside from the other available actions, modals can be dismissed by pressing the ESC key.
- Follow the accessibility guidelines for each element used in the modal. View guidelines