-
Notifications
You must be signed in to change notification settings - Fork 5
Blocks Modal Next Phase
Current Version: 1.2.0 Last Updated: 2025-11-19 Status: Active Development
Modal Block:
- Customizable dimensions (width, max-width, height, max-height)
- Animation types (fade, slide-up, slide-down, zoom, none)
- Overlay customization (color, opacity, blur)
- Close button with 4 position options (inside/outside, left/right)
- Full WordPress block supports (colors, typography, spacing, borders)
- Responsive behavior optimized for mobile and tablet
- Accessibility features (ARIA attributes, keyboard support)
- Body scroll locking
Modal Trigger Block:
- Button with 3 styles (fill, outline, link)
- Icon support with positioning (start, end, none)
- Width options (auto, full)
- Target modal via ID
- Full block supports for customization
Technical Foundation:
- Modal portaling to document.body to escape stacking contexts
- Context API for modal ID and close behavior
- Proper z-index handling (max safe integer)
- Reduced motion support
- High contrast mode support
User Story: As a site owner, I want to open a modal by linking to a specific URL hash so I can link directly to modal content.
Implementation:
// Example: https://example.com/page#dsgo-modal-newsletter
// Automatically opens modal with ID "dsgo-modal-newsletter"New Modal Attributes:
-
allowHashTrigger(boolean, default: true)
Technical Notes:
- Listen for URL hash changes
- Open modal on page load if hash matches
- Update URL when modal opens (optional)
- Handle browser back button
User Story: As a marketer, I want modals to automatically open based on user behavior to increase engagement.
New Trigger Block Variation: "Auto Trigger"
Trigger Types:
-
Page Load
- Delay (ms): 0-30000
- Frequency: Every visit, Once per session, Once per user (cookie)
- Cookie duration (days): 1-365
-
Exit Intent
- Sensitivity: Low, Medium, High
- Minimum time on page (seconds)
- Exclude mobile devices (boolean)
-
Scroll Depth
- Trigger at % scrolled: 25, 50, 75, 100
- Direction: Down only, Up or Down
-
Time on Page
- Seconds on page: 0-300
- Frequency: Once per session, Every time
New Attributes:
{
"autoTriggerType": {
"type": "string",
"enum": ["none", "pageLoad", "exitIntent", "scroll", "time"]
},
"autoTriggerDelay": {
"type": "number",
"default": 0
},
"autoTriggerFrequency": {
"type": "string",
"enum": ["always", "session", "once"]
},
"scrollDepth": {
"type": "number",
"default": 50
},
"timeOnPage": {
"type": "number",
"default": 30
}
}UI Considerations:
- Add "Auto Trigger" panel in Modal settings
- Clear indicators when auto-trigger is active
- Preview mode in editor (don't actually trigger)
- Test button to preview trigger behavior
User Story: As a content creator, I want pre-built modal templates to quickly create common use cases.
Block Variations:
-
Newsletter Signup
- Pre-configured with form pattern
- Best practice dimensions and styling
- Exit intent trigger enabled
-
Video Player
- Optimized dimensions for 16:9 video
- Auto-play on open, pause on close
- Black overlay, no padding
-
Image Gallery/Lightbox
- Full-screen dimensions
- Minimal chrome, just close button
- Keyboard navigation hints
-
Cookie Notice
- Bottom-aligned variation
- Sticky positioning
- Remember choice functionality
-
Promo/Announcement
- Eye-catching defaults
- CTA button pattern
- Time-limited display option
Implementation:
- Use
variationsin block.json - Pre-configured attributes and innerBlocks templates
- Custom icons for each variation
User Story: As a photographer, I want to display a gallery of images in modals with navigation between them.
New Feature: Modal Navigation
- Previous/Next buttons
- Keyboard arrow key support
- Swipe gestures on mobile
- Thumbnail navigation (optional)
Technical Implementation:
- New context:
modalGroupId - Multiple modals can belong to same group
- Navigation rendered dynamically
- Focus management between modals
User Story: As a developer, I want programmatic control over modals for custom integrations.
Public API:
// Global namespace
window.dsgoModal = {
open: (modalId, options) => {},
close: (modalId) => {},
closeAll: () => {},
isOpen: (modalId) => boolean,
on: (event, callback) => {},
off: (event, callback) => {}
};
// Events
dsgoModal.on('modalOpen', ({ modalId, element }) => {});
dsgoModal.on('modalClose', ({ modalId, element }) => {});
dsgoModal.on('modalBeforeOpen', ({ modalId, element }) => {});
dsgoModal.on('modalBeforeClose', ({ modalId, element }) => {});Use Cases:
- Form validation before close
- Analytics tracking
- Custom animations
- Third-party integrations
User Story: As a developer, I want to customize modal behavior server-side.
Filters:
// Modify modal attributes before render
apply_filters('designsetgo/modal/attributes', $attributes, $block);
// Add custom data attributes
apply_filters('designsetgo/modal/data_attributes', $data_attrs, $attributes);
// Modify modal classes
apply_filters('designsetgo/modal/classes', $classes, $attributes);Actions:
// Before modal block renders
do_action('designsetgo/modal/before_render', $attributes, $block);
// After modal block renders
do_action('designsetgo/modal/after_render', $attributes, $block);- Lazy load modal content (don't render until first open)
- Intersection Observer for auto-triggers
- Debounce scroll/resize handlers
- Reduce JavaScript bundle size
- CSS containment for better painting
- Screen reader testing with NVDA/JAWS
- Focus trap improvements
- Better keyboard navigation hints
- ARIA live regions for dynamic content
- Reduced motion enhancements
- Custom animation builder (GUI)
- Animation presets library
- Border shadows/glows
- Glassmorphism effects
- Pattern overlays
- E2E tests for all trigger types
- Unit tests for modal utilities
- Visual regression tests
- Comprehensive user documentation
- Developer API documentation
- Video tutorials
- URL hash triggering
- Page load auto-trigger
- Basic modal patterns (5 variations)
- Exit intent trigger
- Scroll depth trigger
- Time-based trigger
- Frequency tracking (session/once per user)
- Cookie/localStorage management
- Modal gallery/navigation system
- Previous/Next navigation buttons
- Keyboard navigation (arrow keys)
- Touch gesture support (swipe)
- Gallery-specific block variations (4 templates)
- Flexible navigation positioning (sides/top/bottom)
- Multiple navigation styles (arrows/chevrons/text)
- Comprehensive gallery documentation
- JavaScript API (core methods)
- Additional block variations
- PHP filters/actions
- Performance optimizations
- Custom animation builder
- Advanced templates
- Complete API
- Comprehensive testing suite
-
Cookie Storage: Use first-party cookies or localStorage for frequency tracking?
- Cookies: Better for server-side integration, privacy regulations
- localStorage: Better for SPA-like experiences, no server overhead
-
Analytics Integration: Should we provide built-in analytics hooks?
- Google Analytics
- Google Tag Manager
- Custom events
-
Form Integration: How deep should form integration go?
- Basic: Just container for forms
- Advanced: Form validation, AJAX submission, success/error handling
-
Monetization: Any premium features?
- All features free (current model)
- Pro version with advanced triggers/analytics
- Freemium model with limits
- Download/install rate
- Active installations
- User ratings/reviews
- Support ticket volume
- Most used modal types
- Most popular trigger methods
- Average customization depth
- Performance impact
- API usage statistics
- GitHub issues/PRs
- Community contributions
- Documentation clarity
- Popup Maker: Full-featured WordPress popup plugin
- OptinMonster: Marketing-focused popup builder
- Elementor Popup: Page builder integration
- Kadence Modal: Block-based approach
Feedback Welcome: This is a living document. Suggestions and prioritization feedback appreciated!
Auto-generated from
docs/blocks/modal/MODAL-NEXT-PHASE.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Blobs
- Breadcrumbs
- Card
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Flip Card
- Form Builder
- Grid
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Next Phase
- Modal Performance Fixes
- Modal Security Audit
- Modal Security Fixes Summary
- Modal Trigger
- Pill
- Progress Bar
- Reveal
- Row
- Scroll Accordion
- Scroll Gallery
- Section
- Slider
- Table Of Contents
- Tabs
- Timeline
- Animation
- Background Video
- Block Animations
- Clickable Group
- Custom Css
- Expanding Background
- Grid Mobile Order
- Grid Span
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Text Alignment Inheritance
- Text Reveal
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Control Reorganization
- Design System
- Wordpress Block Editor Best Practices
- Color Controls Pattern
- Custom Css Filters
- Performance Css Strategy
- Width Css Strategy Implementation
- Width Layout Patterns
- Antigravity Audit
- Card Block Audit
- Claude Audit
- Comprehensive Audit
- Cursor Audit
- Scroll Accordion Stacking Notes
- Security Review 1.2.1
- 2026 02 11 Icon Search Aliases Design
- 2026 02 14 Overlay Header Design
- 2026 02 15 Deactivation Block Migrator Design