Skip to main content

Create new blocks ✨

To add new blocks, run:

npx plop # note the x in npx

This asks what pattern of block you want to add (atom, molecule or organism), and than creates the files for it and updates other files where necessary (like index files for Twig, JS, SCSS and ACF groups).

Adding lots of blocks?

Then first add the initial folders, like:

src/patterns/03-organisms/repeatable-custom/my-new-custom-block-a
src/patterns/03-organisms/repeatable-custom/my-new-custom-block-b
src/patterns/03-organisms/single/some-single-block-a
src/patterns/03-organisms/single/some-single-block-b
src/patterns/03-organisms/single/some-single-block-c
etc

And run npm plop - this should trigger the bulk plopper. Output you'll see:

Plopping "my-new-custom-block-a"...
Plopping "my-new-custom-block-b"...
Plopping "some-single-block-a"...
Plopping "some-single-block-b"...
Plopping "some-single-block-c"...
[etc]

Bulk plopping done
To create more: add folders, or run npx plop again

PRO TIP: Check git status or commit tool of your IDE to easily see what files are added or modified.