Within your app project, the source code for dashboard modals is found in the src/dashboard/modals
folder.
Each modal is defined in its own subfolder that contains two files:
modal.json
: Defines the modal metadata.modal.tsx
: Defines the modal content.The modal.json
file contains the dashboard modal metadata.
The modal metadata is defined using the following schema, shown here as a TypeScript type:
Field | Type | Description |
---|---|---|
id | string | The modal ID (GUID) is automatically generated and shouldn't be changed. The ID is used to register the modal in the app dashboard. The ID must be unique across all pages in the app. |
title | string | The modal title. The title is used to refer to the modal in the app dashboard. |
width | number | Initial width of the modal while loading, in pixels. Width may be adjusted dynamically based on the content of the modal or limited by the size of the modal's container. |
height | number | Initial height of the modal while loading, in pixels. Height may be adjusted dynamically based on the content of the modal or limited by the size of the modal's container. |
Here's an example metadata definition:
The modal.tsx
file contains the dashboard modal content.
The content is defined as a React component that renders when the modal is active.
Inside a dashboard modal component you may choose to use: