Searchstudio-ux-js Archives - SearchStax Docs Documentation Tue, 07 Nov 2023 18:14:58 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.2 https://www.searchstax.com/docs/wp-content/uploads/2023/10/cropped-favicon-32x32.png Searchstudio-ux-js Archives - SearchStax Docs 32 32 What is searchstudio-ux-js https://www.searchstax.com/docs/searchstudio/overview-searchstudio-ux-js/ Wed, 26 Jul 2023 09:55:54 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15863 What is searchstudio-ux-js Introducing SearchStudio-UX-JS: Empowering Frontend Applications with Stunning Search Experiences SearchStudio-UX-JS is an advanced VanillaJS components library specifically designed to streamline the development of exceptional search interfaces within… Continue reading What is searchstudio-ux-js

The post What is searchstudio-ux-js appeared first on SearchStax Docs.

]]>
What is searchstudio-ux-js

Introducing SearchStudio-UX-JS: Empowering Frontend Applications with Stunning Search Experiences

SearchStudio-UX-JS is an advanced VanillaJS components library specifically designed to streamline the development of exceptional search interfaces within your frontend application.

Goal of the Components Library

The primary goal of the library is to offer a comprehensive UI ecosystem that seamlessly integrates with your project, taking care of the frontend and UI aspects while harnessing the powerful search functionality of SearchStudio in the background.

By leveraging searchstudio-ux-js, you gain access to an assortment of ready-to-use components, including a versatile search box, results list, dynamic filters, and more. These components can be effortlessly combined to create distinctive and visually captivating search UIs. The library’s focus on performance, accessibility, and aesthetic appeal abstracts away complexities, allowing you to concentrate on crafting truly remarkable search experiences.

Strengths of searchstudio-ux-js

One of the key strengths of SearchStudio-UX-JS lies in its full integration with SearchStax Studio. As a result, you can seamlessly leverage the complete suite of search features offered by SearchStudio, such as typo tolerance, synonyms, and dynamic filters, without concerning yourself with intricate UI implementation.

Get started now to build awesome search experiences faster than ever before with searchstudio-ux-js.

The post What is searchstudio-ux-js appeared first on SearchStax Docs.

]]>
Getting Started UX-JS https://www.searchstax.com/docs/searchstudio/searchstudio-ux-js-getting-started/ Wed, 26 Jul 2023 09:59:45 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15865 Getting Started Installation Import Import the Searchstax class into your code: Instantiation Create a new instance of the Searchstax class: Initialization Initialize the Searchstax instance by passing a configuration object:… Continue reading Getting Started UX-JS

The post Getting Started UX-JS appeared first on SearchStax Docs.

]]>
Getting Started

Installation

npm install --save @searchstax-inc/searchstudio-ux-js

Import

Import the Searchstax class into your code:

import Searchstax from '@searchstax-inc/searchstudio-ux-js';


Instantiation

Create a new instance of the Searchstax class:

const searchstax = new Searchstax();


Initialization

Initialize the Searchstax instance by passing a configuration object:

searchstax.initialize({
  // options
});


See the Configuration section for details on the options available.

Widgets

Add widgets by invoking the respective add methods:

searchstax.addSearchInputWidget({/* options */});
searchstax.addSearchResultsWidget({/* options */});
// etc


Refer to the Widgets section for details on each widget.

Styles

Import the default CSS styles:

@import '@searchstax-inc/searchstudio-ux-js/dist/styles/mainTheme.css';


See the Styling section for information on theming and customization.

The post Getting Started UX-JS appeared first on SearchStax Docs.

]]>
Widget Configuration https://www.searchstax.com/docs/searchstudio/widget-configuration/ Wed, 26 Jul 2023 10:40:45 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15897 Widget Configuration The UI library provides several widgets that can be configured and added to a page. Each widget has a configuration object that defines its options. Widget Description Implementation… Continue reading Widget Configuration

The post Widget Configuration appeared first on SearchStax Docs.

]]>
Widget Configuration

The UI library provides several widgets that can be configured and added to a page. Each widget has a configuration object that defines its options.

WidgetDescriptionImplementation
InputRenders the search input box and handles search suggestions/auto-completeInput Widget Docs
ResultsDisplays the core search results with titles, descriptions, images etc.Results Widget Docs
PaginationProvides pagination controls and status for search result pagesPagination Widget Docs
FacetsDisplays faceted filters that allow drilling down search resultsFacets Widget Docs
Search FeedbackShows search feedback message with number of results and corrected queriesSearchFeedback Widget Docs
Related SearchesDisplays algorithmically generated related searches for the current queryRelated Searches Widget Docs
External PromotionsRenders promotional content from external sourcesExternal Promotions Widget Docs
SortingProvides controls to sort search results by predefined options like date, relevance etc.Sorting Widget Docs

Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post Widget Configuration appeared first on SearchStax Docs.

]]>
Styling https://www.searchstax.com/docs/searchstudio/styling/ Wed, 30 Aug 2023 17:51:00 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15892 Styling The searchstudio-ux-js library comes with a default CSS theme located at: To use the default styling, simply import this CSS file: Customization The default CSS classes can be overridden… Continue reading Styling

The post Styling appeared first on SearchStax Docs.

]]>
Styling

The searchstudio-ux-js library comes with a default CSS theme located at:

node_modules/@searchstax-inc/searchstudio-ux-js/dist/styles/mainTheme.css


To use the default styling, simply import this CSS file:

@import 'node_modules/@searchstax-inc/searchstudio-ux-js/dist/styles/mainTheme.css';


Customization

The default CSS classes can be overridden to customize the styling:

.searchstax-search-input {
  /* Override default input styling */
}

.searchstax-result {
  /* Override result styling */
}

/* Override other CSS class names */


For more extensive customization, the SCSS source files can be imported and modified:

@import 'node_modules/@searchstax-inc/searchstudio-ux-js/dist/styles/scss/mainTheme.scss';

// Override SCSS variables and mixins


See the source SCSS files for the various mixins, variables, and selectors that can be customized.

Theming

To create a new theme, the main SCSS file can be used as a starting point:

@import 'mainTheme.scss';

// Override variables and custom CSS


This allows building on top of the default theme with new styling and theme variables.

Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post Styling appeared first on SearchStax Docs.

]]>
JS Widgets https://www.searchstax.com/docs/searchstudio/searchstudio-ux-js-widgets/ Wed, 30 Aug 2023 17:55:02 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15889 Widgets for searchstudio-ux-js To learn more about the SearchStudio-UX-JS Widgets, follow the links to each page to see the templates and examples: Questions? Do not hesitate to contact the SearchStax… Continue reading JS Widgets

The post JS Widgets appeared first on SearchStax Docs.

]]>
Widgets for searchstudio-ux-js

To learn more about the SearchStudio-UX-JS Widgets, follow the links to each page to see the templates and examples:

Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post JS Widgets appeared first on SearchStax Docs.

]]>
Input Widget JS https://www.searchstax.com/docs/searchstudio/widgets-search-input/ Wed, 30 Aug 2023 17:53:12 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15886 Input Widget JS The Input widget provides the search input field with autosuggest/autocomplete capabilities. Usage Template Override The input widget template option allows customizing the UI templates. mainTemplate Main wrapper… Continue reading Input Widget JS

The post Input Widget JS appeared first on SearchStax Docs.

]]>
Input Widget JS

The Input widget provides the search input field with autosuggest/autocomplete capabilities.

Usage

searchstax.addSearchInputWidget(container, options);


Template Override


The input widget template option allows customizing the UI templates.

mainTemplate

Main wrapper template for the input box.

  • Template model: {} (plain object)
  • Usage:
templates: {

  mainTemplate: {
    template: `
      <div class="input-wrap">
        <input id="search-input">
      </div>
    `
  }

}


autosuggestItemTemplate

Renders each autosuggestion item.

templates: {
  autosuggestItemTemplate: {
    template: '<div>{{term}}</div>'
  }
}


This renders the input widget with customized templates and hooks for full control over the input behavior and appearance.


Example

searchstax.addSearchInputWidget("searchstax-input-container", {
    suggestAfterMinChars: 3,
    hooks: {
      afterAutosuggest: function (result: ISearchstaxSuggestResponse) {

      },
      beforeAutosuggest: function (props: ISearchstaxSuggestProps) {

      },
    },
    templates: {
    mainTemplate: {
        template: `
        <div class="searchstax-search-input-container">
            <div class="searchstax-search-input-wrapper">
                <input type="text" id="searchstax-search-input" class="searchstax-search-input" placeholder="SEARCH FOR..." />
                <button class="searchstax-spinner-icon" id="searchstax-search-input-action-button"></button>
            </div>
        </div>
        `,
        searchInputId: "searchstax-search-input"
    }
    autosuggestItemTemplate: {
        template: `
        <div class="searchstax-autosuggest-item-term-container">{{{term}}}</div>
        `,
    }
    },
  });


Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post Input Widget JS appeared first on SearchStax Docs.

]]>
Results Widget JS https://www.searchstax.com/docs/searchstudio/widgets-search-results/ Wed, 30 Aug 2023 18:02:20 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15881 Results Widget JS The Results Widget for UX-JS displays the search results. Usage Template Override The result widget template option allows customizing the UI templates. mainTemplate Main wrapper template for… Continue reading Results Widget JS

The post Results Widget JS appeared first on SearchStax Docs.

]]>
Results Widget JS

The Results Widget for UX-JS displays the search results.

Usage

searchstax.addSearchResultsWidget(container, options);


Template Override


The result widget template option allows customizing the UI templates.

mainTemplate

Main wrapper template for the results section.

  • Template model: {} (plain object)
  • Usage:
templates: {

  mainTemplate: {
    template: `
      <div class="results-wrap">
        <div id="results"></div>
      </div>
    `
  }

}


searchResultTemplate

Template for each individual search result.

templates: {

  searchResultTemplate: {
    template: `
      <div class="result">
        <h3>{{title}}</h3>
        <p>{{description}}</p>
      </div>
    `
  }

}


noSearchResultTemplate

Template shown when there are no results.

  • Template model:
    • spellingSuggestion – Suggested spelling correction
    • searchTerm – Search term used
  • Usage:
templates: {

  noSearchResultTemplate: {
    template: `
      <div>
        No results found for <b>{{searchTerm}}</b>.

        {{#spellingSuggestion}}
          Did you mean <b>{{spellingSuggestion}}</b>?
        {{/spellingSuggestion}}
      </div>
    `
  }

}



Example

searchstax.addSearchResultsWidget('results', {

  templates: {

    mainTemplate: {
      template: `
        <div id="results-container"></div>
      `,
      searchResultsContainerId: 'results-container'
    },

    searchResultTemplate: {
      template: `
        <div class="result">
          <a href="{{url}}" data-id="{{id}}"></a>
          <!-- result content -->
        </div>
      `,
      searchResultUniqueIdAttribute: 'data-id'
    },

    noSearchResultTemplate: {
      template: `
        <div>No results found.</div>
      `
    }

  },

  hooks: {
    afterLinkClick: (result) => {
      // handle click
    }
  }

});


This renders the results widget using custom templates and hooks for handling search result clicks.

Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post Results Widget JS appeared first on SearchStax Docs.

]]>
Facets Widget JS https://www.searchstax.com/docs/searchstudio/widgets-facets/ Wed, 30 Aug 2023 18:01:31 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15879 Facets Widget JS The Facets Widget for UX-JS displays faceted filters for search. Usage Multiple Instances Multiple instances of the Facets widget can be added by calling the addFacetsWidget method… Continue reading Facets Widget JS

The post Facets Widget JS appeared first on SearchStax Docs.

]]>
Facets Widget JS

The Facets Widget for UX-JS displays faceted filters for search.

Usage

searchstax.addFacetsWidget(container, options);


Multiple Instances

Multiple instances of the Facets widget can be added by calling the addFacetsWidget method multiple times with different target containers:

searchstax.addFacetsWidget('container1', options1);

searchstax.addFacetsWidget('container2', options2);

Each instance can be configured separately via its options object. This allows for the widget to be added to different locations on the page as needed.

Template Override


The facet widget template option allows customizing the UI templates.

mainTemplateDesktop

Main wrapper template for desktop facets display.

templates: {

  mainTemplateDesktop: {
    template: `
      <div class="desktop-facets"></div>
    `,
    facetsContainerId: 'desktop-facets'
  }

}


mainTemplateMobile

Main wrapper template for mobile facets display.

templates: {

  mainTemplateMobile: {
    template: `
      <div class="mobile-facets"></div>
    `,
    facetsContainerId: 'mobile-facets'
  }

}


showMoreButtonContainerTemplate

Template for the show more button when collapsing facets.

templates: {

  showMoreButtonContainerTemplate: {
    template: `
      <div class="show-more">
        Show More
      </div>
    `,
    showMoreButtonClass: 'show-more'
  }

}


facetItemContainerTemplate

Template for each facet group.

templates: {

  facetItemContainerTemplate: {
    template: `
      <div class="facet-group">
        <div class="facet-group-name"></div>
        <div class="facet-options"></div>
      </div>
    `,

    facetListTitleContainerClass: 'facet-group-name',
    facetListContainerClass: 'facet-options'
  }

}


clearFacetsTemplate

Template for clear all filters button.

  • Template model: {shouldShow: boolean}
  • Usage:
templates: {

  clearFacetsTemplate: {
    template: `
      <div class="clear-filters">
        Clear All Filters
      </div>
    `
  }

}


facetItemTemplate

Template for each facet value item.

templates: {

  facetItemTemplate: {
    template: `
      <input type="checkbox" class="facet-checkbox">
      <div class="facet-label">{{label}} ({{count}})</div>
    `
  }

}


filterByTemplate

Template for the filter by pill.

  • Template model: {} (plain object)
  • Usage:
templates: {

  filterByTemplate: {
    template: `
      <div class="filter-pill">
        Filter By
      </div>
    `
  }

}


selectedFacetsTemplate

Template for selected facet pills.

templates: {

  selectedFacetsTemplate: {
    template: `
      <div class="selected-facet-pill">
        {{label}} ({{count}})
        <span class="remove"></span>
      </div>
    `
  }

}


The IFacetValueRange interface is for numeric range facets.


Example

searchstax.addFacetsWidget('searchstax-facets-container', {

  facetingType: 'and',

  itemsPerPageDesktop: 5,
  itemsPerPageMobile: 3,

  templates: {

    mainTemplateDesktop: {
      template: `
        <div class="desktop-facets"></div>
      `,
      facetsContainerId: 'desktop-facets'
    },

    mainTemplateMobile: {
      template: `
        <div class="mobile-facets"></div>
      `,
      facetsContainerId: 'mobile-facets'
    },

    showMoreButtonContainerTemplate: {
      template: `
        <div class="show-more">
          Show More
        </div>
      `,
      showMoreButtonClass: 'show-more' 
    },

    facetItemContainerTemplate: {
      template: `
        <div class="facet-group">
          <div class="facet-group-name"></div>
          <div class="facet-options"></div>
        </div>
      `,
      facetListTitleContainerClass: 'facet-group-name',
      facetListContainerClass: 'facet-options'
    },

    // other templates

  }

});

Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post Facets Widget JS appeared first on SearchStax Docs.

]]>
Pagination Widget JS https://www.searchstax.com/docs/searchstudio/widgets-pagination/ Wed, 30 Aug 2023 18:00:39 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15877 Pagination Widget JS Displays a pagination control for UX-JS. Usage Multiple Instances Multiple instances of the Pagination widget can be added by calling the addPaginationWidget method multiple times with different… Continue reading Pagination Widget JS

The post Pagination Widget JS appeared first on SearchStax Docs.

]]>
Pagination Widget JS

Displays a pagination control for UX-JS.

Usage

searchstax.addPaginationWidget(container, options);


  • container – Element to render widget into
  • options – Configuration options (Read more)

Multiple Instances

Multiple instances of the Pagination widget can be added by calling the addPaginationWidget method multiple times with different target containers:

searchstax.addPaginationWidget('container1', options1);

searchstax.addPaginationWidget('container2', options2);

Each instance can be configured separately via its options object. This allows for the widget to be added to different locations on the page as needed.

Template Override


The pagination widget template option allows customizing the UI templates.

mainTemplate

Main template for the pagination controls.

templates: {

  mainTemplate: {
    template: `
      <div class="pagination">

        <button class="previous {{#isFirstPage}}disabled{{/isFirstPage}}">
          Previous
        </button>

        <span class="page-info">
          {{startIndex}} - {{endIndex}} of {{totalResults}}
        </span>

        <button class="next {{#isLastPage}}disabled{{/isLastPage}}">
          Next
        </button>

      </div>
    `
  }

}


The IPaginationData interface provides pagination metadata to use in the template.


Example

searchstax.addPaginationWidget('pagination', {

  templates: {

    mainTemplate: {
      template: `
        <div class="pagination">
          <a class="prev-btn"></a>
          <div class="page-info">1-10 of 100</div>
          <a class="next-btn"></a>
        </div>
      `,
      previousButtonClass: 'prev-btn',
      nextButtonClass: 'next-btn'
    }

  }

});


Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post Pagination Widget JS appeared first on SearchStax Docs.

]]>
Search Feedback Widget JS https://www.searchstax.com/docs/searchstudio/widgets-search-feedback/ Wed, 26 Jul 2023 23:14:37 +0000 https://www.searchstax.com/docs/?post_type=searchstudio&p=15875 Search Feedback Widget JS Displays search feedback and stats for UX-JS. Usage Multiple Instances Multiple instances of the SearchFeedback widget can be added by calling the addSearchFeedbackWidget method multiple times… Continue reading Search Feedback Widget JS

The post Search Feedback Widget JS appeared first on SearchStax Docs.

]]>
Search Feedback Widget JS

Displays search feedback and stats for UX-JS.

Usage

searchstax.addSearchFeedbackWidget(container, options);


  • container – Element to render widget into
  • options – Configuration options (Read more)

Multiple Instances

Multiple instances of the SearchFeedback widget can be added by calling the addSearchFeedbackWidget method multiple times with different target containers:

searchstax.addSearchFeedbackWidget('container1', options1);

searchstax.addSearchFeedbackWidget('container2', options2);

Each instance can be configured separately via its options object. This allows for the widget to be added to different locations on the page as needed.

Template Override


The searchFeedback widget template option allows customizing the UI templates.

mainTemplate

Main template for the search feedback message.

templates: {

  main: {
    template: `
      <div class="search-feedback">

        Showing <b>{{startIndex}} - {{endIndex}}</b> of <b>{{totalResults}}</b> results for <b>{{searchTerm}}</b>

        <div class="searchstax-feedback-container-suggested">
                  {{#autoCorrectedQuery}}
                    Search instead for <a href="#" class="searchstax-feedback-original-query">{{originalQuery}}</a>
                  {{/autoCorrectedQuery}}
                </div>

      </div>
    `
  }

}


The ISearchstaxSearchFeedbackData interface provides search metadata to use in the template.


Example

searchstax.addSearchFeedbackWidget('search-feedback-container', {

  templates: {

    main: {
      template: `
        <div class="feedback">
          Showing X-Y of Z results for "<query>"
          
          <a class="original-query">Did you mean <b>original</b>?</a> 
        </div>
      `,
      originalQueryClass: 'original-query'
    }

  }

});

Questions?

Do not hesitate to contact the SearchStax Support Desk.

The post Search Feedback Widget JS appeared first on SearchStax Docs.

]]>