Support Menu

Coveo component Quickview

This component is meant to exist within a result template. It allows to create a button/link inside the result list that opens a modal box for a given result.

Most of the time, this component will reference a QuickviewDocument in its content template.

Choosing what to display for the Quickview

The Quick View uses any HTML structure you put inside its tag and uses that as the content of the dialog box. This content can thus be any element you decide, using your CSS and your structure.


  • You can change the appearance of the Quick View link by adding HTML inside the body of the div.

  • You can change the content of the Quick View link by specifying a template ID.

  • You can use the methods of the CoreHelpers in the template.

<!-- This would change the appearance of the quickview button itself in the result. -->
<div class="CoveoQuickview" data-template-id="TemplateId">
  <span>Click here for Quickview</span>

<!-- This would modify the content of the quickview when it is opened in the modal box -->
<script class='result-template' type='text/underscore' id='TemplateId' >
    <span>This is the content that will be displayed when you open the Quick View. You can also include any other Coveo components.</span>
    <table class="CoveoFieldTable">
      <tr data-field="@liboardshorttitle" data-caption="Board" />
      <tr data-field="@licategoryshorttitle" data-caption="Category" />
      <tr data-field="@sysauthor" data-caption="Author" />

<!-- Note that this is all optional: Just including a <div class='CoveoQuickview'></div> will do the job most of the time, and will include a default template and default button appearance -->


Component Options


alwaysShow: boolean

Specifies whether the quickview is always shown, even when the index body for a document is empty.
In such cases, the Quickview.options.contentTemplate specifies what appears in the quickview.
If there is no quickview for the document, you MUST specify a contentTemplate otherwise the component will throw an error when opened.

Markup configuration example(s) :


contentTemplate: Template

Specifies the template to use to present the Quick View content in the modal window.


showDate: boolean

Specifies whether to show the document date in the Quick View modal window header.
The default value is true.

Markup configuration example(s) :


size: string

Specifies the Quick View modal window size (width and height) relative to the full window.
The default value is 95% on a desktop and 100% on a mobile device.

Markup configuration example(s) :


title: string

Specifies the title of your choice that appears at the top of the Quick View modal window.

Markup configuration example(s) :



  • close(): void


  • debugInfo(): any


  • disable(): void
  • Disable the component. Normally this means that the component will not execute handlers for the framework events (query events, for example). Component are enabled by default on creation.

    Returns void


  • enable(): void
  • Enable the component. Normally this means that the component will execute handlers for the framework events (query events, for example). Components are enabled by default on creation.

    Returns void



  • open(): void

Static get

  • get(element: HTMLElement, componentClass?: any, noThrow?: boolean): BaseComponent
  • Get the bound component to the given HTMLElement. Throws an assert if the HTMLElement has no component bound, unless using the noThrow argument.
    If there is multiple component bound to the current HTMLElement, you must specify the component class.


    • element: HTMLElement

      HTMLElement for which to get the bound component.

    • Optional componentClass: any

      Optional component class. If the HTMLElement has multiple components bound, you must specify which one you are targeting.

    • Optional noThrow: boolean

      Boolean option to tell the method to not throw on error.

    Returns BaseComponent



Allows the component to bind events and execute them only when it is enabled.




componentOptionsModel: ComponentOptionsModel

Contains the state of options for differents component. Mainly used by ResultLink.


componentStateModel: ComponentStateModel

Contains the state of different component (enabled vs disabled). Allows to get/set values. Trigger component state event when modified. Each component can listen to those events.


disabled: boolean

A disabled component will not participate in the query, or listen to ComponentEvents.




logger: Logger

Allows component to log in the dev console.


queryController: QueryController

Contains the singleton that allows to trigger queries.


queryStateModel: QueryStateModel

Contains the state of the query. Allows to get/set values. Trigger query state event when modified. Each component can listen to those events.


root: HTMLElement

A reference to the root HTMLElement (the SearchInterface).


searchInterface: SearchInterface

A reference to the root of every component, the SearchInterface.


usageAnalytics: IAnalyticsClient

A reference to the Analytics.client.

Static ID

ID: string

The static ID that each component need to be identified.
For example, SearchButton -> static ID : SearchButton -> className : CoveoSearchButton



  • Create a new Component. Resolve all IComponentBindings if not provided.
    Create a new Logger for this component. Attach the component to the SearchInterface.


    • element: HTMLElement

      The HTMLElement on which to create the component. Used to bind data on the element.

    • type: string

      The unique identifier for this component. See : IComponentDefinition.ID. Used to generate the unique Coveo CSS class associated with every component.

    • Default value bindings: IComponentBindings = {}

      The environment for every component. Optional, but omitting to provide one will impact performance.

    Returns Quickview