1.8.0 • Published 4 months ago

@yext/search-ui-react v1.8.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
4 months ago

search-ui-react

A library of React Components for powering Yext Search integrations.

See the full documentation here.

Getting Started

If you are using NPM 7+, you can install the components with the following command:

npm install @yext/search-ui-react

The @yext/search-headless-react peer dependency will be automatically installed.

If you are using NPM 6 or Yarn, you can install the library and its peer dependencies with this command:

npx install-peerdeps @yext/search-ui-react

The command will work with Yarn so long as NPM 6+ is installed on the machine.

Once the library and its peer dependencies are installed, our React Components should be nested inside the SearchHeadlessProvider. SearchHeadlessProvider requires a SearchHeadless instance, which is created using provideHeadless(...) with the appropriate credentials:

import { provideHeadless, SearchHeadlessProvider } from '@yext/search-headless-react';
import { SearchBar, UniversalResults, VerticalConfigMap } from '@yext/search-ui-react';
import { v4 as uuidv4 } from 'uuid';

const config = {
  apiKey: '<apiKey>',
  experienceKey: '<experienceKey>',
  locale: 'en',
  experienceVersion: 'PRODUCTION',
}

const searcher = provideHeadless(config);

searcher.setSessionTrackingEnabled(true);
let sessionId = window.sessionStorage.getItem('sessionId');
if (!sessionId) {
  sessionId = uuidv4();
  window.sessionStorage.setItem('sessionId', sessionId);
}
searcher.setSessionId(sessionId);

const verticalConfigMap: VerticalConfigMap = {
  help_articles: {
    label: "Help Articles"
  }
}

function App() {
  return (
    <SearchHeadlessProvider searcher={searcher}>
      <SearchBar />
      <UniversalResults verticalConfigMap={verticalConfigMap}/>
    </SearchHeadlessProvider>
  );
}

export default App;

To use the Component Library's Styling without adding Tailwind to your project, add the following import:

import '@yext/search-ui-react/bundle.css'

Compatibility Notes

This library and its dependencies use optional chaining and other modern TS syntax that is not inherently supported by Webpack <5 (e.g. via create-react-app@4). Additional Babel plugins are needed for transpiling if using legacy versions.

1.8.0

4 months ago

1.7.2

4 months ago

1.7.1

4 months ago

1.8.0-beta

4 months ago

1.7.0

5 months ago

1.6.5

8 months ago

1.7.0-beta.9

9 months ago

1.7.0-beta.10

8 months ago

1.6.4

9 months ago

1.6.3

9 months ago

1.7.0-beta.8

9 months ago

1.7.0-beta.7

10 months ago

1.6.2

10 months ago

1.7.0-beta.6

10 months ago

1.7.0-beta.5

11 months ago

1.7.0-beta.3

12 months ago

1.7.0-beta.4

12 months ago

1.6.1

11 months ago

1.7.0-beta

12 months ago

1.6.0

1 year ago

1.6.0-beta.432

1 year ago

1.5.0

1 year ago

1.5.0-beta.426

1 year ago

1.4.1

1 year ago

1.4.0

2 years ago

1.4.0-alpha.0

2 years ago

1.4.0-alpha.1

2 years ago

1.4.0-alpha.2

2 years ago

1.4.0-alpha.3

2 years ago

1.4.0-alpha.8

2 years ago

1.4.0-alpha.9

2 years ago

1.4.0-alpha.4

2 years ago

1.4.0-alpha.5

2 years ago

1.4.0-alpha.6

2 years ago

1.4.0-alpha.7

2 years ago

1.4.0-beta.3

2 years ago

1.4.0-alpha.19

2 years ago

1.4.0-alpha.17

2 years ago

1.4.0-alpha.18

2 years ago

1.4.0-alpha.15

2 years ago

1.4.0-alpha.16

2 years ago

1.4.0-alpha.13

2 years ago

1.4.0-alpha.14

2 years ago

1.4.0-alpha.11

2 years ago

1.4.0-alpha.12

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.4.0-alpha.10

2 years ago

1.3.2

2 years ago

1.3.0

2 years ago

1.4.0-alpha.28

2 years ago

1.4.0-alpha.27

2 years ago

1.4.0-alpha.24

2 years ago

1.4.0-alpha.25

2 years ago

1.4.0-alpha.22

2 years ago

1.4.0-alpha.23

2 years ago

1.4.0-alpha.20

2 years ago

1.4.0-alpha.21

2 years ago

1.3.0-beta.1

2 years ago

1.2.0

2 years ago

1.3.0-beta.0

2 years ago

1.2.1

2 years ago

1.2.1-beta.0

2 years ago

1.2.0-beta.0

2 years ago

1.1.0

2 years ago

1.1.0-beta.335

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-alpha.301

3 years ago

1.0.0-beta.298

3 years ago

1.0.0-beta.269

3 years ago

1.0.0-beta.262

3 years ago

0.2.0-beta.243

3 years ago