Skip to main content

setFormFactor(formFactorConfig)

Sets the form factor of the existing bar. Can be set as a modal (default), or as an inline bar.

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 the inline CommandBar will render. Can either be the ID of an element on the page, or an Element (e.g., from document.querySelector).

``