Search Modal Block

The Search Modal Block enhances your WordPress site with a modern, popup search interface that’s both beautiful and functional. Built specifically for the block editor (Gutenberg), it provides a seamless way to add search functionality to any part of your content.

Key Features:

  • Clean, minimal design that works with any theme
  • Fully responsive layout
  • Accessibility-ready with ARIA labels and keyboard navigation
  • Customizable text elements:
    • Search input placeholder
    • Search button text
    • Screen reader labels
  • Focus-visible support for better keyboard navigation
  • Seamless integration with WordPress search

Perfect For:

  • Minimalist themes needing an elegant search solution
  • Sites wanting to improve their search UX
  • Accessibility-focused websites
  • Any WordPress site using the block editor

Development

This block is built using the WordPress Create Block tool, ensuring compatibility with modern WordPress standards and practices. The source code is available in the plugin’s /src directory.

Building from Source

To build the plugin from source:

  1. Clone the repository
  2. Install dependencies with npm install
  3. Run npm run build to build the production files
  4. For development, use npm run start to start the development server

The build process uses @wordpress/scripts to compile and minify the JavaScript and CSS files. The source code for the compiled files in the /build directory can be found in the /src directory.

Development Dependencies

  • @wordpress/scripts: ^27.9.0
  • @wordpress/eslint-plugin: ^21.4.0
  • @wordpress/stylelint-config: ^21.41.0
  • eslint: ^8.57.1

The complete source code is available on GitHub: https://github.com/philhoyt/search-modal-block

Credits

This plugin uses the following third-party libraries:

  • MicroModal – A lightweight, configurable modal library for web applications.
0

评论0

 
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
显示验证码
没有账号?注册  忘记密码?

社交账号快速登录