ReactJS Boilerplate (WordPress libraries only)
React built with only the @wordpress/* libraries WordPress already ships at runtime — no
Mantine, no third-party UI kit. The result feels native in wp-admin and keeps your bundle tiny.
Quick links
- Repo: wpbones/WPKirk-ReactJS-Boilerplate
- Playground: launch the blueprint
- ZIP download: wpkirk-reactjs-boilerplate.zip
Runtime dependencies
{
"dependencies": {
"@wordpress/components": "^32",
"@wordpress/data": "^10",
"@wordpress/hooks": "^4"
}
}react, react-dom, @wordpress/element, @wordpress/i18n are provided by WordPress at runtime
(webpack externalises them via @wordpress/scripts’ default config).
What the demo shows
apps/app.tsx renders:
- A
Noticewith a greeting string that’s passed throughapplyFilters('wpkirk.greeting', …)— other plugins can override it via@wordpress/hooks. - A Counter card with
Buttoncomponents and auseCountercustom hook. - A controlled
TextControlwith a liveHello, {name}output.
apps/use-counter.ts is the tiny reusable hook, covered by 5 Jest tests that exercise it through
@testing-library/react’s renderHook + act.
Highlights
- Native wp-admin look —
Card,Button,TextControl,Notice,Flexfrom@wordpress/componentsmatch the surrounding admin UI. - React 18
createRootfrom@wordpress/element. - i18n through
@wordpress/i18nwith__andsprintf. - Extensibility via
@wordpress/hooksfilters — other plugins can hook into your UI strings. - Testing via
@testing-library/react+ Jest.
Use this when
You want to build a Gutenberg-friendly plugin, integrate with WordPress data stores, or stay on the WordPress-provided React runtime without adding a third-party UI library. This is the sweet spot for plugins that live in wp-admin and want to look native.
