Configure the enquiry form
Every MedosEnquiry option with its type and default, the init, open and close methods, and the MedosEnquiryConfig TypeScript type.
A small surface: a key, where to mount, how it looks, and three callbacks. Want to try options before writing code? Use the playground.
Methods
init(config)
MedosEnquiry.init(config: MedosEnquiryConfig): voidMounts inline, or opens the modal immediately when mode is "modal".
Required: apiKey. Plus containerId when mounting inline.
open(config?)
MedosEnquiry.open(config?: Partial<MedosEnquiryConfig>): voidOpens the form as a modal, merging the argument into the last-known config.
It can be the first call — pass apiKey to it and no init() is needed. Throws
if no apiKey has ever been set.
close()
MedosEnquiry.close(): voidCloses the modal and fires
onClose.
Options
Core
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey | string | Yes | — | Your Medos publishable key. See API keys. |
mode | "modal" | "inline" | No | "inline" | Modal overlays the page; inline mounts into containerId. |
containerId | string | For inline | — | DOM id the form mounts into. |
Appearance
The enquiry widget takes the same theming options as every other Medos widget — built-in theme names and the flat brand shortcuts included.
| Option | Type | Default | Description |
|---|---|---|---|
theme | "default" | "modern" | MedosTheme | PartialTheme | "default" | Built-in name, full theme object, or partial override. See Theming. |
primaryColor | string | From theme | Brand colour. Hover and active shades are derived automatically. |
secondaryColor | string | From theme | Secondary brand colour. |
borderRadius | string | number | From theme | Corner radius. A number means px. |
fontFamily | string | From theme | CSS font stack applied across the form. |
fontUrl | string | — | Stylesheet URL (e.g. Google Fonts) loaded so fontFamily resolves. |
fontSize | "small" | "medium" | "large" | "medium" | Scales every font size proportionally. |
MedosEnquiry.init({
apiKey: "mk_your_publishable_key",
mode: "inline",
containerId: "medos-enquiry",
theme: "modern",
primaryColor: "#4f46e5",
});A hand-authored theme object (PartialTheme) works too.
Callbacks
onSuccess, onError, and onClose. See
Callbacks.
Not accepted
Unlike the booking widget and the portal, this widget has no maxWidth,
maxHeight, otpChannels, or booking-scope options. Size it with your own
container.
MedosEnquiryConfig type
interface MedosEnquiryConfig {
/** Required. Your publishable key. */
apiKey: string;
// mounting
mode?: "modal" | "inline";
containerId?: string;
// appearance
theme?: "default" | "modern" | MedosTheme | PartialTheme;
primaryColor?: string;
secondaryColor?: string;
borderRadius?: string | number;
fontFamily?: string;
fontUrl?: string;
fontSize?: "small" | "medium" | "large";
// callbacks
onSuccess?: (enquiry: EnquirySubmission) => void;
onError?: (error: Error) => void;
onClose?: () => void;
}