The searchable field (type: "searchable") displays a drop-down list in the modal form() dialog that lets you select one of the available options. You can type in the select field to quickly filter the matching options.
The syntax is compatible with the select form field. At this moment, the searchable field doesn't support a hierarchy of options but this feature is coming soon.
The options array items have the following structure:
import {Modal} from "@daypilot/modal"; // ... async function searchable() { const resources = [ { name: "Resource A", id: "A" }, { name: "Resource B", id: "B" }, { name: "Resource C", id: "C" }, ]; const form = [ { name: "Resource", id: "resource", options: resources, type: "searchable", }, ]; const data = { resource: "B", }; const modal = await Modal.form(form, data); console.log(modal.result); }