Function modal

Creates a modal component that serves as the main container for UI elements. The modal is typically used as the root container when displaying UI through showUI.

Either the content to display or the options object

Configuration object

Header title text

Header description text

Icon element to display that can be a string or a React node

URL of the image to display

The content to display (only used when options are provided)

A JSX element representing the modal component

Basic usage with content

modal([
headerBar({
title: 'Welcome to the Matterway SDK',
description: 'This is a sample welcome message.',
}),
group([
inputField({
name: 'firstName',
label: 'First name',
defaultValue: 'Jane',
}),
]),
]);

Usage with options and content

modal(
{
title: 'Welcome to the Matterway SDK',
description: 'This is a sample welcome message.',
},
[
group([
inputField({
name: 'email',
label: 'Email',
type: 'email',
}),
]),
]
);