Skip to main content

setFormFactor(formFactorConfig)

Sets Spotlight's formfactor, which can be either a modal (default) or inline.

Example

// Sets Spotlight's formfactor to inline, and sets Spotlight's parent element
window.CommandBar.setFormFactor({
type: "inline",
rootElement: document.querySelector("#foo"),
});

Method parameters

formFactorConfig Required

object

PropertyTypeDescription
type Required'modal''modal' opens Spotlight as a modal (default behavior), while 'inline' opens Spotlight in the supplied rootElement. If this is set to 'inline', rootElement (see below) must also be passed.
rootElementobjectRequired if formFactor is set to 'inline'. The element where Spotlight will render inline. Can either be the ID of an element on the page, or an Element (e.g., from document.querySelector).

``