diff --git a/README.md b/README.md
index 30ad3ac..19fd813 100644
--- a/README.md
+++ b/README.md
@@ -379,6 +379,11 @@ class Section extends Brick
return new HtmlString('');
}
+ public static function getTags(): array
+ {
+ return ['section', 'content', 'layout'];
+ }
+
/**
* @throws Throwable
*/
@@ -404,6 +409,19 @@ class Section extends Brick
}
```
+### Brick Tags
+
+Bricks can optionally declare tags to improve discoverability when searching the editor sidebar. When a user types in the search box, Mason will match against both the brick's label and any of its tags, so a search for "marketing" can surface a brick whose label is "Hero" as long as that tag is defined.
+
+```php
+public static function getTags(): array
+{
+ return ['hero', 'banner', 'header', 'landing page', 'marketing'];
+}
+```
+
+By default, `getTags()` returns an empty array, so tags are entirely optional.
+
## Rendering Content
You are free to render the content however you see fit. The data is stored in the database as JSON, so you can use the data however you see fit. But the plugin offers a helper method for converting the data to HTML should you choose to use it.
diff --git a/resources/views/components/brick-picker-modal.blade.php b/resources/views/components/brick-picker-modal.blade.php
index 61e9181..e87ba75 100644
--- a/resources/views/components/brick-picker-modal.blade.php
+++ b/resources/views/components/brick-picker-modal.blade.php
@@ -3,7 +3,7 @@
])
@php
- $brickIds = array_map(fn ($brick) => $brick::getLabel(), $bricks);
+ $brickData = array_map(fn ($brick) => ['label' => $brick::getLabel(), 'tags' => $brick::getTags()], $bricks);
@endphp