Download the PHP package humanmade/wp-pattern-library without Composer
On this page you can find all versions of the php package humanmade/wp-pattern-library. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download humanmade/wp-pattern-library
More information about humanmade/wp-pattern-library
Files in humanmade/wp-pattern-library
Package wp-pattern-library
Short Description Serve a manifest and isolated previews of a WordPress site's registered block patterns, so a pattern library can be generated from them.
License GPL-2.0-or-later
Informations about the package wp-pattern-library
WP Pattern Library
Generate a browsable Markdown pattern library โ with screenshots โ from a WordPress site's registered block patterns.
๐ Documentation
A block theme of any size is going to end up with dozens or hundreds of patterns. That is a design system, and it has the design system problem: the names live in patterns/*.php, the appearance lives in the block inserter behind a login, and neither is somewhere you can point at.
This plugin generates the missing artifact. The site serves a manifest of its registered patterns and renders each one in isolation; a Node CLI captures them with Playwright and writes an index plus one page per category. The result is Markdown and images you commit โ so it renders on GitHub, it is searchable, and when a pattern's appearance changes, the changed screenshot shows up in review.
It works against your local environment or a live site. A GitHub Action can run the whole thing and open a pull request with the refreshed docs.
Install
Three separate packages ship from this repository, all from the same tag:
| Name | How you use it | |
|---|---|---|
| WordPress plugin | humanmade/wp-pattern-library |
composer require humanmade/wp-pattern-library |
| CLI | @humanmade/wp-pattern-library |
npm install -D @humanmade/wp-pattern-library |
| GitHub Action | humanmade/wp-pattern-library |
uses: humanmade/[email protected] |
The plugin belongs on the site you capture from. The CLI runs wherever you generate the library โ your machine, or CI โ so the site itself never needs Node. The action is a thin wrapper around the CLI for running the whole thing in a workflow; pin it to a released tag, as there is deliberately no moving @v1 tag while the package is pre-1.0.
Quick start
Full walkthrough, including the things that catch people out: Getting started.
Commands
Screenshots are written only when their bytes change, so re-running does not churn images whose content merely shifted underneath them. The run summary flags patterns that rendered empty, failed outright, or referenced resources that no longer load.
What you get
Each pattern gets its screenshot, description, categories, keywords, block and post types, and the viewport it was captured at.
Beyond the basics, the generator can capture section variants (the same pattern on a second ground), give query-loop item templates a post to bind to, settle scroll-triggered animations before capturing, and group categories into a multi-level taxonomy.
Requirements
WordPress 6.1+ ยท PHP 8.1+ ยท Node 24+
Documentation
| About | What it does, and what it deliberately does not. |
| Getting started | Install and first capture, against a local site. |
| WordPress plugin | What it adds to a site, access control, endpoints, filters. |
| NPM package | Every config option, CLI commands, output. |
| GitHub Action | Running it in CI against a live site. |
Design decisions are recorded as ADRs in docs/architecture/.
Contributing
Bug reports, ideas and pull requests are all welcome. See docs/roadmap.md for things that have been thought about but not built.
License
GPL-2.0-or-later