Skip to content

BhargavBhandari90/toggle-content-block

Repository files navigation

Toggle Content Block

Lint JS WPCS

Contributors: bhargavbhandari90
Donate link: https://www.paypal.me/BnB90/20
Tags: block, toggle, switch, tabs, content toggle
Requires at least: 6.7
Tested up to: 6.8
Stable tag: 1.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Easily switch between two distinct content sections ("Left" and "Right") using a toggle or switch interface.

Description

The Toggle Content Block lets you create two separate content sections — Left Content and Right Content — and switch between them instantly.

Perfect for:

  • Before/after comparisons
  • Feature toggles
  • Multi-step content
  • Organizing information in an interactive way

Features:

  • Preloaded Left & Right toggle content blocks.
  • Allow any Gutenberg inner blocks inside each section.
  • Customizable labels for the toggle control.
  • Works with WordPress ToggleControl or Material UI Switch.
  • Responsive and flexible styling.

Installation

  1. Upload the plugin files to the /wp-content/plugins/toggle-content-block directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress.
  3. Add/Edit a post or page and search "Toggle Content" while searching for a block.
  4. Fill Left and Right sections with any blocks you want.

Demo

https://www.youtube.com/watch?v=drjJLmMAr3E

Prerequisites

Development Setup

  1. Go to plugin's root
  2. Run npm install
  3. To watch for changes, run npm start

Development

To create a publish ready plugin, run:

npm run build

To format code, run:

npm run format

Found a Bug?

If you find a bug, report here https://github.com/BhargavBhandari90/toggle-content-block/issues

Changelog

1.0.0

  • Initial Release.