Skip to content

The primary repository that I contributed to during my Yext internship (Summer 2022).

License

Notifications You must be signed in to change notification settings

alextaing/search-ui-react

 
 

Repository files navigation

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, the components can be rendered using React by placing them inside the SearchHeadlessProvider with the appropriate credentials:

import { SearchHeadlessProvider } from '@yext/search-headless-react';
import { SearchBar, UniversalResults } from '@yext/search-ui-react';

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

function App() {
  return (
    <SearchHeadlessProvider {...config}>
      <SearchBar />
      <UniversalResults />
    </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'

About

The primary repository that I contributed to during my Yext internship (Summer 2022).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.3%
  • Other 1.7%