Elasticpress React

Use ElasticPress with React.
Alternatives To Elasticpress React
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Wp Calypso12,2351684613 hours ago28August 24, 20225,127gpl-2.0JavaScript
The JavaScript and API powered WordPress.com
Woocommerce8,561131413 hours ago460October 12, 20212,204otherPHP
A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
Headless Wp Starter4,338
2 months ago52gpl-2.0JavaScript
🔪 WordPress + React Starter Kit: Spin up a WordPress-powered React app in one step
Frontity2,842667a month ago60July 19, 202266apache-2.0TypeScript
» Frontity - The React Framework for WordPress
Wordexpress1,585
5 years ago8mitJavaScript
WordPress using Node, React, GraphQL, and Apollo
Jetpack1,484
20 hours ago18July 12, 20222,572otherPHP
Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
Faustjs1,15323 days ago22July 12, 202214otherTypeScript
Faust.js™ - The Headless WordPress Framework
Nextjs Wordpress Starter647
3 months ago12September 08, 202162gpl-2.0JavaScript
A headless starter for WordPress powered by Next.js.
Gatsby Woocommerce Themes558
5 months ago7December 29, 202055mitJavaScript
⚡ A Gatsby Theme for WooCommerce E-commerce site Gatsby WooCommerce WordPress
Nextjs Headless Wordpress534
13 days ago1October 06, 202023gpl-3.0JavaScript
🔥 Nextjs Headless WordPress
Alternatives To Elasticpress React
Select To Compare


Alternative Project Comparisons
Readme

ElasticPress React

ElasticPress React is a library of React components to supercharge your headless WordPress website with ElasticPress.

Support Level Release Version GPLv2 License

Requirements

Installation

To install ElasticPress React, simply install via npm:

npm install @10up/elasticpress-react --save

You will need an Elasticsearch instance and a WordPress website running ElasticPress.

Components

ElasticPressProvider

You must wrap your application with ElasticPressProvider in order to use the ElasticPress components.

	<ElasticPressProvider
		node="http://elasticpress.test/__elasticsearch"
		indexName="elasticpresstest-post-1"
	>
		{/* ElasticPress Components */}
	</ElasticPressProvider>

Autosuggest

This component outputs a search field that when typed in will autosuggest results to the user.

import { AutosuggestField } from '@10up/elasticpress-react';

const MyComponent = () => (
	<>
		<p>Here is my fancy new component.</p>

		<p>Here's a search input with autosuggest:</p>

		<ElasticPressProvider
				node="http://elasticpress.test/__elasticsearch"
				indexName="elasticpresstest-post-1"
				loadInitialData={false}
			>
				<AutosuggestField />
			</ElasticPressProvider>
	</>
);

Screenshot

Autosuggest screenshot

Related Content

This component outputs content related to a post.

import { RelatedContent } from '@10up/elasticpress-react';

const MyComponent = () => (
	<>
		<p>Here is my fancy new component.</p>

		<p>Here is some related content to post 5:</p>

		<RelatedContent
			wpApiRoot="https://mysite.com/wp-json"
			postId="5"
		/>
	</>
);

Search and Post Results

import { PostContextProvider, SearchField, Posts } from '@10up/elasticpress-react';

const MyComponent = () => {
	// Make sure to wrap your components with the provider.
	return (
		<ElasticPressProvider
			node="http://elasticpress.test/__elasticsearch"
			indexName="elasticpresstest-post-1"
		>
			<div>
				<SearchField />
			</div>

			<div>
				<Posts />
			</div>
		</ElasticPressProvider>
	);
};

Screenshot

Posts screenshot

Support Level

Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.

Changelog

A complete listing of all notable changes to ElasticPress React components are documented in CHANGELOG.md.

Contributing

Please read CODE_OF_CONDUCT.md for details on our code of conduct, CONTRIBUTING.md for details on the process for submitting pull requests to us, and CREDITS.md for a listing of maintainers of, contributors to, and libraries used by ElasticPress React components.

Like what you see?

Work with us at 10up

Popular Reactjs Projects
Popular Wordpress Projects
Popular Web User Interface Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Javascript
Reactjs
Wordpress
Elasticsearch
Screenshot
Autocomplete