JavaScript - Answer Widget

Use the SearchstaxAnswerWidget to add AI answers to a custom JavaScript search page. Configure when Read More appears, optional feedback controls, and template overrides.

Usage

searchstax.addAnswerWidget("searchstax-answer-container", {
  showShowMoreAfterWordCount: 100,
  feedbackwidget: feedbackConfig,
});

Props

  • showShowMoreAfterWordCount – number (default 100) determining after how many words UI will show "Read More" view.
  • feedbackWidget – an optional object that configures thumbs-up and thumbs-down feedback functionality.
  • templates – template override. See examples at searchstax-ux-js.

Example

See the full example at searchstax-ux-js.

Articles in this section