dxw / govpress-blocks
Reusable custom blocks for WordPress
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 8
Forks: 0
Open Issues: 0
pkg:composer/dxw/govpress-blocks
Requires
- php: ^7.4||^8.0
- stoutlogic/acf-builder: ^1.12
Requires (Dev)
- dxw/php-cs-fixer-config: ^2.0
- kahlan/kahlan: ^5.2
This package is auto-updated.
Last update: 2025-10-26 00:04:02 UTC
README
A library of reusable blocks for use in GovPress projects.
How to use
- Install the package in your theme:
composer require dxw/govpress-blocks
- Use the factory to create the blocks you want to use, and pass them any configuration, e.g.
To create a card block with default config:
 To create a card block that renders a custom template:\Dxw\GovPressBlocks\Factory::create('card');
 For dxw projects, the recommended approach is to add this code to your theme's\Dxw\GovPressBlocks\Factory::create('card', [ 'template' => '\the\full\path\to\your\custom\template.php` ]);app/di.php, if the theme uses Iguana.
- If you want to use the default styles for a block, import them into your main SASS file like so (where the final name in the path is the block type):
@import 'vendor/dxw/govpress-blocks/assets/scss/blocks/card'
The available blocks are documented below.
Blocks
Card
\Dxw\GovPressBLocks\Factory::create('card', array $config)
Config options:
[
    'template' => string $theFullPathToYourCustomCardTemplate
]
Sass:
@import 'vendor/dxw/govpress-blocks/assets/scss/blocks/card'