Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions packages/create-block-interactive-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,38 @@ npx @wordpress/create-block --template @wordpress/create-block-interactive-templ

It requires at least WordPress 6.5 or Gutenberg 17.7.

## Variants

This template exposes three variants. Use the `--variant` flag to select one:

### `default`

The standard interactive block scaffold. Uses the Interactivity API to demonstrate reactive state, context, and DOM event handling.

```bash
npx @wordpress/create-block --template @wordpress/create-block-interactive-template --variant default
```

This is also the variant used when no `--variant` flag is provided.

### `typescript`

Same as `default` but the view script (`view.ts`) is written in TypeScript, with fully typed store state and context.

```bash
npx @wordpress/create-block --template @wordpress/create-block-interactive-template --variant typescript
```

### `client-side-navigation`

Demonstrates client-side navigation powered by `@wordpress/interactivity-router`. The block renders a quote navigator whose Prev / Next links swap page content without a full reload. A client-side stopwatch running outside the router region proves that no full page reload occurred.

```bash
npx @wordpress/create-block --template @wordpress/create-block-interactive-template --variant client-side-navigation
```

This variant adds `@wordpress/interactivity-router` as an additional npm dependency.

## Contributing to this package

This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
Expand Down
Loading