Pikari Gutenberg Accordion
Wordpress plugin that adds an accordion/toggle block. Utilizes core blocks for maximum compatibility
by Pikari Inc. · github.com/hellopikari/pikari-gutenberg-accordion · website
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/hellopikari/pikari-gutenberg-accordion/releases/download/v1.1.1/pikari-gutenberg-accordion.zipReadme
Pikari Gutenberg Accordion
A fully accessible WordPress Gutenberg block plugin for creating accordion/toggle content sections with optional FAQ schema markup.
Description
Pikari Gutenberg Accordion provides a modern, accessible accordion block for the WordPress block editor. Perfect for FAQs, documentation, product features, or any collapsible content. The block features smooth animations, customizable icons, and full accessibility support.
Features
- 🎯 Gutenberg Native: Built with WordPress Block Editor best practices
- ♿ Fully Accessible: WCAG 2.1 compliant with ARIA attributes and keyboard navigation
- 🎨 Theme Integration: Inherits colors, spacing, and typography from theme.json
- 📱 Responsive: Mobile-first design that works on all devices
- 🔍 SEO Friendly: Optional Schema.org FAQ structured data
- ⚡ Performance Optimized: Lightweight vanilla JavaScript, no jQuery dependency
- 🎛️ Highly Customizable: CSS variables, PHP/JS filters, and block supports
Requirements
- WordPress 6.8 or higher
- PHP 8.3 or higher
- Modern browser with JavaScript enabled
Installation
From WordPress Admin
- Download the plugin ZIP file from the releases page
- Navigate to Plugins → Add New in your WordPress admin
- Click "Upload Plugin" and select the ZIP file
- Click "Install Now" and then "Activate"
Via Composer from GitHub
# Add the repository
composer config repositories.pikari-accordion vcs https://github.com/HelloPikari/pikari-gutenberg-accordion
# Install latest stable version
composer require pikari-inc/pikari-gutenberg-accordion:^1.0
The plugin will be installed to wp-content/plugins/pikari-gutenberg-accordion/ with all production files included.
For complete Composer installation documentation, see Composer Installation Guide.
Manual Installation
- Download the source code from the releases page
- Extract to your WordPress plugins directory:
wp-content/plugins/pikari-gutenberg-accordion/ - Activate through WordPress admin
Usage
Basic Usage
- In the block editor, click the "+" button to add a new block
- Search for "Accordion" and select the Pikari Gutenberg Accordion block
- Each accordion automatically includes one accordion item
- Click into the heading to add your question or title
- Click into the content area to add your answer or content
- Click "Add Accordion Item" to add more items
FAQ Variation
- When adding the block, select the "FAQ" variation
- This pre-configures the block for FAQ content
- Optionally enable Schema.org markup in the block settings panel
- The schema markup helps search engines understand your FAQ content
Block Settings
Accordion Container Settings
- Allow Multiple Expanded: Allow multiple items to be open simultaneously
- Enable Animations: Toggle smooth expand/collapse transitions
- Icon Style: Choose between chevron, plus/minus, arrow, or none
- Enable Schema.org: Add FAQ structured data (FAQ variation only)
Accordion Item Settings
- Initially Expanded: Set whether the item is open by default
Style Settings (Block Supports)
- Colors: Background, text, and link colors
- Spacing: Padding, margin, and block gap
- Border: Style, width, color, and radius
- Typography: Inherited from the heading block
Customization
CSS Variables
Customize the accordion appearance using CSS variables:
.wp-block-pikari-gutenberg-accordion {
--pikari-gutenberg-accordion-icon-size: 1.25em;
--pikari-gutenberg-accordion-icon-rotation: 180deg;
--pikari-gutenberg-accordion-transition-duration: 0.3s;
--pikari-gutenberg-accordion-transition-easing: ease-in-out;
--pikari-gutenberg-accordion-icon-color: currentColor;
--pikari-gutenberg-accordion-hover-opacity: 0.8;
}
PHP Filters
Customize Icon HTML
add_filter('pikari_gutenberg_accordion_icon_html', function($html, $style) {
if ($style === 'custom') {
return '<svg><!-- Your custom SVG --></svg>';
}
return $html;
}, 10, 2);
Modify Schema.org Data
add_filter('pikari_gutenberg_accordion_schema_data', function($data, $attributes) {
// Modify schema data structure
return $data;
}, 10, 2);
JavaScript Hooks
// Customize icon via JavaScript
wp.hooks.addFilter(
'pikari.accordion.iconHTML',
'my-theme/accordion-icon',
(html, style, isExpanded) => {
// Return custom icon HTML
return html;
}
);
JavaScript Events
Listen for accordion events:
document.addEventListener('pikari-gutenberg-accordion:toggle', (e) => {
console.log('Accordion toggled:', e.detail.expanded);
});
document.addEventListener('pikari-gutenberg-accordion:open', (e) => {
console.log('Accordion opened');
});
document.addEventListener('pikari-gutenberg-accordion:close', (e) => {
console.log('Accordion closed');
});
Accessibility
- ✅ Semantic HTML: Uses appropriate heading levels and regions
- ✅ ARIA Support: Proper aria-expanded, aria-controls, and aria-labelledby
- ✅ Keyboard Navigation: Enter and Space keys to toggle items
- ✅ Focus Management: Visible focus indicators for keyboard users
- ✅ Screen Readers: Fully compatible with NVDA, JAWS, and VoiceOver
- ✅ Motion Preferences: Respects prefers-reduced-motion setting
Development
Setup Development Environment
# Install dependencies
npm install
composer install
# Run development build with watch mode
npm start
# Build for production
npm run build
# Run all linters
npm run lint:all
# Fix auto-fixable linting issues
npm run lint:fix
# Test in WordPress Playground
npm run playground
# Create distributable plugin ZIP
npm run plugin-zip
Available Scripts
npm start- Start development build with file watchingnpm run build- Create optimized production buildnpm run lint:all- Run JS, CSS, PHP, and Markdown lintersnpm run lint:fix- Auto-fix all fixable linting issuesnpm run lint:js- Lint JavaScript filesnpm run lint:css- Lint CSS/SCSS filesnpm run lint:php- Lint PHP filesnpm run playground- Launch WordPress Playground for testingnpm run plugin-zip- Create distributable plugin ZIP file
Documentation
For Users
- Installation and Usage - Getting started guide
- Customization - Styling and configuration options
- Accessibility - Accessibility features and compliance
- Composer Installation - Complete Composer installation guide
For Developers
- Development Workflow - Complete development setup and workflow
- Release Management - How releases work and how to create them
- Contributing Guidelines - How to contribute to this project
Contributing
We welcome contributions! Please follow our development workflow:
- Read the guides: Start with Development Workflow
- Fork the repository and create a feature branch
- Follow coding standards: Run
npm run lint:allbefore committing - Add proper labels: Label your PRs for automated changelog generation
- Submit a Pull Request: Include a clear description of changes
Quick Start for Contributors
# Fork and clone the repository
git clone https://github.com/HelloPikari/pikari-gutenberg-accordion.git
cd pikari-gutenberg-accordion
# Install dependencies
npm install && composer install
# Create feature branch
git checkout -b feature/your-feature-name
# Start development
npm start
# Test your changes
npm run playground
See Development Workflow for complete setup instructions.
Browser Support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
License
GPL-2.0-or-later
Author
Pikari Inc.
- Email: development@pikari.io
- Homepage: https://pikari.io
Releases
This project uses automated release management:
- Latest Release: See Releases for downloadable versions
- Release Notes: Automatically generated from pull request labels and titles
- Changelog: See CHANGELOG.md for version history
- Creating Releases: See Release Management Guide for maintainers
Release Process
- Development → Pull requests with proper labels
- Auto-Draft → Release notes automatically generated
- Review & Publish → Maintainer publishes when ready
- Distribution → ZIP file automatically built and attached
For detailed information, see our Release Management Guide.
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v1.1.1 | Sep 30, 2025 | checksums.txt | 0 |
| v1.1.1 | Sep 30, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.1.0 | Sep 25, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.1.0 | Sep 25, 2025 | checksums.txt | 0 |
| v1.0.10 | Sep 19, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.10 | Sep 19, 2025 | checksums.txt | 0 |
| v1.0.9 | Sep 16, 2025 | checksums.txt | 0 |
| v1.0.9 | Sep 16, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.8 | Sep 8, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.8 | Sep 8, 2025 | checksums.txt | 0 |
| v1.0.7 | Sep 8, 2025 | checksums.txt | 0 |
| v1.0.7 | Sep 8, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.6 | Sep 3, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.6 | Sep 3, 2025 | checksums.txt | 0 |
| v1.0.5 | Sep 2, 2025 | checksums.txt | 0 |
| v1.0.5 | Sep 2, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.4 | Sep 2, 2025 | checksums.txt | 0 |
| v1.0.4 | Sep 2, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.3 | Aug 27, 2025 | checksums.txt | 0 |
| v1.0.3 | Aug 27, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.2 | Aug 27, 2025 | checksums.txt | 0 |
| v1.0.2 | Aug 27, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.1 | Aug 27, 2025 | checksums.txt | 0 |
| v1.0.1 | Aug 27, 2025 | pikari-gutenberg-accordion.zip | 0 |
| v1.0.0 | Aug 27, 2025 | checksums.txt | 0 |