PHPackages                             nicholashamilton/craft-preview-mate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nicholashamilton/craft-preview-mate

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

nicholashamilton/craft-preview-mate
===================================

Find live preview matrix blocks with ease.

4.1.1(5mo ago)46223mitPHPPHP &gt;=8.2CI failing

Since Oct 31Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/nicholashamilton/craft-preview-mate)[ Packagist](https://packagist.org/packages/nicholashamilton/craft-preview-mate)[ RSS](/packages/nicholashamilton-craft-preview-mate/feed)WikiDiscussions craft-5 Synced today

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

PreviewMate v4
==============

[](#previewmate-v4)

Find live preview matrix blocks with ease.

Requirements
------------

[](#requirements)

This plugin supports Craft CMS 5.x

> **Note:** PreviewMate 1.x and 2.x are only compatible with Craft CMS 4.x. PreviewMate 3.x and 4.x are only compatible with Craft CMS 5.x.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    cd /path/to/project
2. Then tell Composer to load the plugin:

    composer require nicholashamilton/craft-preview-mate
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for PreviewMate.

How to use
----------

[](#how-to-use)

[![PreviewMate v4 Demo](./resources/img/PreviewMate_v4_Demo.gif)](./resources/img/PreviewMate_v4_Demo.gif)

Preview blocks will be tracked in live preview by adding `data-preview-block-id` attribute to the entry's HTML element.

```
{# option 1 (recommended) - only rendered in live preview #}
{{ craft.previewMate.previewBlock(entry) }}
```

or

```
{# option 2 - manually set the preview block id #}
data-preview-block-id="{{ entry.id }}"
```

Clicking a preview block will now scroll to and highlight the editor block.

Usage example
-------------

[](#usage-example)

```
{# Matrix field #}
{% set blocks = entry.blocksBuilder.all() %}

{# Render blocks #}
{% for block in blocks %}

        {{ block.render() }}

{% endfor %}
```

It's recommended to add styles for preview blocks using `data-preview-block-id`. Adding the following styles will highlight the preview block on hover.

```
[data-preview-block-id] {
    position: relative;
}
[data-preview-block-id]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(0, 0, 0, .333);
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms ease;
}
[data-preview-block-id].preview-block-hover::after {
    opacity: 1;
}
```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance70

Regular maintenance activity

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~129 days

Recently: every ~105 days

Total

10

Last Release

176d ago

Major Versions

v1.0.2 → 3.0.02024-11-11

2.0.0 → 3.0.22024-11-13

3.0.2 → 4.0.02024-11-13

PHP version history (2 changes)v1.0.1PHP ^8.0.2

3.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/111650772?v=4)[nhco](/maintainers/nhco)[@NHCO](https://github.com/NHCO)

---

Top Contributors

[![nicholashamilton](https://avatars.githubusercontent.com/u/16893152?v=4)](https://github.com/nicholashamilton "nicholashamilton (70 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![gliving-pw](https://avatars.githubusercontent.com/u/93151254?v=4)](https://github.com/gliving-pw "gliving-pw (1 commits)")

---

Tags

craftcms-plugincmsCraftcraftcmscraft-pluginpreviewmatelive preview

### Embed Badge

![Health badge](/badges/nicholashamilton-craft-preview-mate/health.svg)

```
[![Health](https://phpackages.com/badges/nicholashamilton-craft-preview-mate/health.svg)](https://phpackages.com/packages/nicholashamilton-craft-preview-mate)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k69](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.9k](/packages/verbb-comments)[verbb/navigation

Create navigation menus for your site.

92705.0k18](/packages/verbb-navigation)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/workflow

Enforce multi-step review processes for creating entries.

138124.1k1](/packages/verbb-workflow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
