npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wpsyntex/polylang-react-library

v1.0.0

Published

A collection of React components, icons, and utilities for Polylang-related projects.

Readme

Polylang React Library

A unified package of icons, hooks, and utilities for Polylang projects, optimized for WordPress Gutenberg integration.

📦 What's Included

  • SVG Icons - Complete icon library for Polylang projects
  • React Hooks - Custom hooks for language management and state handling
  • API Middlewares - WordPress REST API filtering utilities

🚀 Installation

npm install @wpsyntex/polylang-react-library

The published package ships pre-transpiled JavaScript in build/ (JSX compiled with Babel and @wordpress/babel-preset-default). WordPress and React packages remain peer dependencies so consumers can externalize them (e.g. via webpack externals to wp.* / React).

From GitHub (development)

npm install github:polylang/polylang-react-library

When installing from GitHub, the prepare script builds src/ to build/. That requires a local clone with devDependencies installed (npm install in this repository); prefer the npm package for consumers.

💻 Usage

Icons

import {
	duplication,
	pencil,
	plus,
	synchronization,
	translation,
	trash,
	star,
	SubmenuIcon,
} from '@wpsyntex/polylang-react-library';

function MyToolbar() {
	return (
		<div>
			<button>{ duplication } Duplicate</button>
			<button>{ pencil } Edit</button>
			<button>{ trash } Delete</button>
		</div>
	);
}

Middlewares

import { editorsRequestsFilter, filterPathMiddleware } from '@wpsyntex/polylang-react-library';

// Apply language filtering to editor requests
editorsRequestsFilter( ( options ) => {
	return {
		...options,
		data: {
			...options.data,
			lang: 'en',
		},
	};
} );

Hooks

import {
	useCuratedLanguages,
	useCurrentLanguage,
	useLanguagesList,
} from '@wpsyntex/polylang-react-library';

function LanguageSelector() {
	// Fetch all available languages
	const languages = useLanguagesList();
	
	// Get the current language from the editor
	const currentLanguage = useCurrentLanguage( languages );
	
	// Curate languages with current language first
	const curatedLanguages = useCuratedLanguages(
		languages,
		currentLanguage,
		false
	);
	
	return <div>{ currentLanguage?.name }</div>;
}

🛠️ Development

Setup

npm install
npm run build         # Build src/ to build/

Linting

npm run lint          # Check code
npm run lint:fix      # Fix automatically

📋 Available Exports

  • duplication - Copy/duplicate icon
  • pencil - Edit icon
  • plus - Add/create icon
  • synchronization - Sync icon
  • translation - Translation icon
  • trash - Delete icon
  • star - Favorite/default icon
  • SubmenuIcon - Submenu navigation icon

Middlewares

  • editorsRequestsFilter - Filter WordPress editor requests
  • filterPathMiddleware - Filter requests by path matching

Hooks

  • useCuratedLanguages - Curate languages list with current language first
  • useCurrentLanguage - Get the current language from the editor
  • useLanguagesList - Fetch the list of available languages

📄 Requirements

  • Node.js >= 20.0.0
  • npm >= 10.0.0

Peer Dependencies

This package requires the following peer dependencies (provided by consuming projects):

  • @wordpress/api-fetch >= 7.0.0
  • @wordpress/data >= 10.0.0
  • @wordpress/editor >= 14.0.0
  • @wordpress/element >= 6.0.0
  • @wordpress/primitives >= 4.0.0
  • lodash >= 4.17.0
  • react >= 17.0.0

📄 License

GPL-3.0+