Patterns and the Pattern Lab

The Pattern Lab lists every pattern of the site, previews it in each style variation and width, checks it for accessibility, and records whether it is ready for pages.

For designers and agencies · Leitvia Studio · Editor or administrator · Checked with Leitvia 1.2.69, Leitvia Studio 1.3.65 and Leitvia Pro 0.8.55

Open a pattern in the Lab

A pattern is a ready-made section, such as a hero or a price table, that you add to a page and then fill with your own text.

The pattern Photo collage in the Pattern Lab. The video has no sound; the transcript below has the text of every step.
Transcript of the video
  1. The Pattern Lab lists every pattern of the theme, Studio, Pro and the site.
  2. Open a pattern to see it in every style variation and three widths, checked by axe.

Find a pattern

  1. Open Leitvia Studio › Pattern Lab.
  2. Type a word into Search patterns, for example hero or price.
  3. Optional: filter by Source (Theme, Leitvia Studio, Leitvia Pro, Other plugins and core or My patterns) or by Status.
  4. Click a card to open the pattern.

Each card shows a preview, the name, the status, the source and the last change. The theme Leitvia brings 90 patterns for the inserter, Studio adds 21, and Pro adds the patterns of its industry kits. Other plugins and core covers everything else, including WordPress itself.

The Pattern Lab of Leitvia Studio: a search field, filters and a grid of pattern cards, each with a preview, its name, a status such as New or Approved and its source.
The Pattern Lab of the site Tidepost with the patterns of the SaaS kit.

Check a pattern

  1. Open the pattern. Under Preview, choose a Style variation and a Viewport of 390, 782 or 1440 px.
  2. Open the tab Checks. Design tokens lists fixed values such as a hex color where a role belongs.
  3. Click Run accessibility check. axe, an automatic accessibility tester, checks the pattern in every style variation, viewport and test content.
  4. Open the tab Usage to see on which pages and posts the pattern is used. If the Lab says Usage index is incomplete, click Build index once.

The table under Checks lists each combination with its violations, or No issues.

The detail of the pattern Photo collage in the Pattern Lab: the preview with the choices Style variation and Viewport, the tabs Variants, Checks and Usage, and the details with the status of the pattern.
One pattern in the Lab: preview, tabs and details.
The tab Checks of a pattern after Run accessibility check: the section Accessibility with a table of style variation, viewport and violations, each row with No issues.
The result of the accessibility check, one row per style variation and viewport.

Status of your own patterns

Patterns you made on the site (source My patterns) have a status, so the team sees which sections are ready.

  1. Open the pattern in the Lab.
  2. Under Details, set Status to Draft, In review, Approved or Deprecated. For a deprecated pattern, name its successor under Replaced by.
  3. Raise the Version when you change the pattern, then click Save details.

Patterns in Draft or In review stay out of the inserter of the editor. A pattern that contains other patterns that are not approved yet shows the lower status. Patterns of the theme and of plugins keep their details in their own files, so the Lab shows them read-only.

Approve a pattern for AI agents

AI agents only use patterns the design contract of the theme knows. A pattern from another plugin, a child theme or WordPress itself needs your approval first. This is separate from the status above.

  1. Open the pattern in the Lab. The side column shows Approval for agents.
  2. Optional: set all six values Role, Tone, Layout, Density, Weight and Width, or leave all six on Not set. With them, the composition check knows where the section fits on a page.
  3. Tick the Section kinds it provides, such as a contact section.
  4. Click Approve for agents.

AI agents may now put the pattern on pages. Withdraw approval takes it back.

The side column of a pattern of WordPress in the Pattern Lab: the form Approval for agents with the choices Role, Tone, Layout, Density, Weight and Width and the button Approve for agents.
Approval for agents, for a pattern the theme does not know.

Import and export

  1. To export one of your own patterns, open its menu in the Lab and choose Export. The browser saves a JSON file.
  2. On the other site, click Import patterns above the list.
  3. Under Pattern files, choose one or more JSON files of at most 1 MB each, then click Import.

The patterns appear under My patterns. An approved pattern arrives In review, because its origin is not checked.

The dialog Import patterns of the Pattern Lab: a note on the file format, the file field Pattern files and the buttons Cancel and Import.
The dialog Import patterns.

Composing pages

The description of each pattern in the inserter says when to use it. When an AI agent builds pages, for example while you are vibe coding a WordPress site, it puts approved patterns on the page instead of writing its own markup, so the design stays consistent. Studio scores the order of the sections, and a change that drops a page below the minimum score waits in the Inbox.

For developers

The same with WP-CLI. Import runs as a user, so it needs --user. More in the Developer guide.

wp leitvia patterns list --status=approved
wp leitvia patterns export my-hero my-proof > patterns.json
wp leitvia patterns import patterns.json --user=admin