Abtion Block Library is a WordPress plugin that provides a collection of custom blocks for the block editor.
The Tabs block allows you to create tabbed content areas within your posts or pages. You can add multiple tabs, each containing its own content, and users can switch between them by clicking on the tab headers.
The Accordion block enables you to create collapsible content sections. Each section can be expanded or collapsed by clicking on the header, allowing you to organize content in a compact and user-friendly manner. Additional options include setting the initial state (expanded or collapsed) and customizing the appearance of the accordion headers.
The Trustpilot block allows you to display Trustpilot reviews directly on your website. You can customize the appearance of the reviews and choose how many reviews to show.
The Slider block supports multiple slider types like normal slider, continuous marquee slider, hero progress bar slider and vertical slider. You can add blocks as slides and and customize settings like number of slides per view.
The Multi Switch Panel block allows you to create a panel with multiple switchable sections. Each section can contain different content, and users can switch between them using tabs or buttons.
To start with development, clone the repository and set up a local WordPress environment. Then, follow these steps:
- Navigate to the plugin directory:
cd abtion-block-library- Install the required dependencies:
npm install- Start the development server:
npm startAfter making changes to the library, you must build the updated assets and publish a new version so downstream projects (for example those installing via Composer) can pull the latest release.
Follow these steps:
-
Make your changes and run the build to generate updated assets:
npm run build
Ensure the
build/folder contains the latest output. -
Bump the plugin version in
abtion-block-library.php. -
Update the same version number in
package.json. -
Add an entry to
CHANGELOG.mddescribing the changes. -
Commit and push your changes to the repository.
-
Create a Git tag for the new version (run from the repository root):
git tag v1.1.0
Replace
v1.1.0with the version you set inabtion-block-library.php. -
Push the tag to GitHub:
git push origin v1.1.0
Once the tag is pushed, package managers such as Composer will be able to resolve and install the new version.
This project follows semantic versioning in the format:
MAJOR.MINOR.PATCH
Use the following guidelines when bumping the version:
-
PATCH (
1.1.0 → 1.1.1)
Bug fixes, internal refactors, build changes, or documentation updates that do not affect public APIs or block behavior. -
MINOR (
1.1.0 → 1.2.0)
New blocks, new features, new block attributes, or backward-compatible improvements to existing blocks. -
MAJOR (
1.x.x → 2.0.0)
Breaking changes such as:- removing or renaming blocks
- changing block markup or attributes in a non-backward-compatible way
- removing public APIs or expected behaviors
Always ensure that:
- the version in
abtion-block-library.php - the version in
package.json - the Git tag
all match exactly.
Update CHANGELOG.md for every release, even if the change is small.