neb42 / ui-studio

1 stars 0 forks source link

Modals #16

Open neb42 opened 2 years ago

neb42 commented 2 years ago

A modal is an element that blocks interaction with the rest of the application. This can be a dialog, a drawer, a menu, etc.

My current thinking is that they should be treated like pages, introducing a new element type: type: 'page' | 'widget' | 'customComponentInstance | 'modal';

A new event type is added open-modal and close-modal or toggle-modal. This will similarly to navigate-page.

When a modal is opened the page will not change and the modal will be rendered over it.

Components will receive a new closeModal prop that will close the parent modal.

Should we support nested modals?

neb42 commented 2 years ago

Should a modal have config? Similar to a custom component, but set at the event.

neb42 commented 2 years ago

Single instace (eg. modal or drawer) vs multiple instances (eg. toast). Config option.