Collection of logic-heavy components used in Brave projects.
To install this package using Composer, follow these steps:
-
Install this package with Composer:
composer require yard/brave-components
-
Run the Acorn WP-CLI command to discover this package:
wp acorn package:discover
You can publish the config file with:
wp acorn vendor:publish --provider="Yard\Brave\ComponentsServiceProvider"To only publish the views, run:
wp acorn vendor:publish --provider="Yard\Brave\ComponentsServiceProvider" --tag="views"Shows a back button that determines its link and text by checking the parent page. If the post has no parent, it sets the link to a predefined parent page slug or defaults to "javascript:history.back();".
Usage:
<x-brave-back-button />
<x-brave-back-button text="Terug naar het vacature-overzicht" />
<x-brave-back-button className="custom-class" />Usage:
<x-brave::dialog.trigger dialogId="my-dialog">
Open dialog
</x-brave::dialog.trigger>
<x-brave-dialog id="my-dialog" ariaLabel="My dialog">
<p>This is the content of the dialog.</p>
<x-brave::dialog.trigger dialogId="my-dialog">
Close dialog
</x-brave::dialog.trigger>
</x-brave-dialog>Shows the content of a pattern by its slug. You can find the slug (post name) using the wp post get CLI command and providing the post ID.
Usage:
<x-brave-pattern-content slug="footer" />
<x-brave-pattern-content slug="single-vacancy-contact-information" />Configure the admin behavior of each pattern in the components.php config file to automatically save them as drafts (thus hiding them from the pattern inserter), prevent their deletion, and add custom labels in the admin view.