mount()

Mount any Inline AI placement type into a target DOM element, with full control over injection target, position, dimensions, and overlay behavior.

The mount() method renders an Inline AI placement into your page. You choose the placement type, tell the SDK where to inject it, and optionally pass display options to configure its appearance and behavior. mount() returns a placement ID that you can later pass to unmount() to remove it.

Body-level placements (Placement.Widget and Placement.SearchFab) attach to document.body automatically. You do not need to pass a target for these types.

Signature

mount(
  type: SDKPlacementType,
  target?: InjectConfig | string,
  options?: MountOptions
): string | undefined

Parameters

typeSDKPlacementTypeRequired

The type of placement to mount. Use a value from the Placement enum or the equivalent raw string.

Enum constantString valueRequires target
Placement.SearchEmbed'search-embed'Yes
Placement.SearchIcon'search-icon'Yes
Placement.SearchFab'search-fab'No
Placement.BasicEmbed'basic-embed'Yes
Placement.KeyTakeaways'key-takeaways'Yes
Placement.SingleQuestion'single-question'Yes
Placement.Widget'widget'No
targetInjectConfig | string

Where to inject the placement in the page DOM. Omit for body-level placements (Widget, SearchFab).

Pass a string as shorthand for targeting an element by its id attribute; 'my-container' is equivalent to { containerId: 'my-container' }.

Pass an InjectConfig object for more control:

optionsMountOptions

Display and behavior options for the placement.

Return value

idstring | undefined

A stable placement ID string. Pass this to unmount() to remove the placement later. Returns undefined if the mount failed (for example, if the target element was not found). Errors are logged to the console; the method itself does not throw.

Examples

var { Placement, InputShape, OpenOverlayOn } = window.InlineAI;
 
window.InlineAI.mount(Placement.SearchEmbed, 'search-container', {
  placeholder: 'Search for answers...',
  shape: InputShape.RoundedRectangle,
  openOverlayOn: OpenOverlayOn.Focus,
});
© 2026 Inline AI