-
Notifications
You must be signed in to change notification settings - Fork 5
Blocks Slider
Version: 1.0.0 Category: Design Keywords: slider, carousel, slideshow, gallery, hero
The Slider block creates modern, performant sliders with multiple transition effects, auto-play functionality, and full WordPress block support inside each slide. Perfect for hero sections, image galleries, testimonials, product showcases, and any content that benefits from a slideshow format.
Key Features:
- Multiple Slides Per View - Display 1-6 slides at once on desktop with responsive breakpoints
- 3 Transition Effects - Slide, fade, and zoom animations with customizable timing
- Flexible Sizing - Fixed height or aspect ratio modes with responsive options
- Full Navigation Controls - Customizable arrows and dots with multiple styles and positions
- Auto-play Support - Smart auto-play with pause on hover/interaction and viewport detection
- Touch & Drag Support - Swipe on mobile, drag with mouse on desktop
- Infinite Loop - Seamless infinite scrolling with intelligent clone management
- Keyboard Accessible - Full keyboard navigation with screen reader support
- Any Block Inside - Use headings, paragraphs, images, buttons, forms, or any WordPress block
- Performance Optimized - Efficient rendering with reduced motion support
- Quick Start
- Settings & Configuration
- Common Use Cases
- Best Practices
- Accessibility
- Troubleshooting
- Frequently Asked Questions
-
Add the Slider Block
- In the block editor, click the
+button - Search for "Slider" or find it in the "Design" category
- The block will insert with 3 pre-configured example slides
- In the block editor, click the
-
Customize Default Slides
- Click on any slide to select it
- Edit the heading and paragraph content
- Add background images, change colors, or modify layout
- Each slide is a container that accepts any WordPress blocks
-
Add More Slides
- Click the blue
+button between slides to add a new slide - Or select the Slider block and use the toolbar to insert slides
- Duplicate existing slides to maintain consistent styling
- Click the blue
-
Configure Slider Settings
- With the Slider block selected (not individual slides), open the Settings sidebar
- Adjust layout, navigation, transitions, and behavior options
- Changes apply immediately in the editor preview
-
Test Your Slider
- Use the arrow buttons in the editor to preview navigation
- Click dots to jump to specific slides
- Save and view on the frontend to test all features
Slides Per View (Desktop)
- Range: 1-6 slides
- Default: 1 slide
- How many slides are visible at once on desktop screens
- Use 1 for full-width hero sliders
- Use 2-3 for content carousels
- Use 4-6 for product/image galleries
Slides Per View (Tablet)
- Range: 1-4 slides
- Default: 1 slide
- Number of visible slides on tablet devices (between mobile and desktop breakpoints)
- Typically set to half of desktop value
Slides Per View (Mobile)
- Range: 1-2 slides
- Default: 1 slide
- Number of visible slides on mobile devices
- Usually set to 1 for better mobile experience
Important Note: When using Fade or Zoom effects, slides per view is automatically set to 1 (these effects only work with single slides).
Use Aspect Ratio
- Toggle: On/Off
- Default: Off (uses fixed height)
- When enabled, slider height is determined by aspect ratio instead of fixed pixel height
- Better for responsive designs that need to maintain proportions
Aspect Ratio (when enabled)
- Options: 16:9, 4:3, 21:9, 1:1, 3:2
- Default: 16:9
- Common ratios:
- 16:9 - Widescreen (videos, hero sections)
- 4:3 - Classic (presentations, standard content)
- 21:9 - Ultra-wide (cinematic hero sections)
- 1:1 - Square (Instagram-style, product images)
- 3:2 - Photography (DSLR standard)
Height (when aspect ratio disabled)
- Default: 500px
- Accepts: px, vh, rem units
- Fixed pixel height for the slider
- Use
vh(viewport height) for full-screen sections- Example:
100vh= full screen height - Example:
50vh= half screen height
- Example:
Gap Between Slides
- Default: 20px
- Accepts: px, rem units
- Space between slides when multiple slides are visible
- Set to 0 for seamless edge-to-edge slides
- Increase for card-style layouts
Show Arrows
- Toggle: On/Off
- Default: On
- Displays previous/next navigation arrows
- Essential for desktop users without touch screens
Arrow Style (when arrows enabled)
- Default - Simple chevron arrows
- Circle - Arrows inside circular backgrounds
- Square - Arrows inside square backgrounds
- Minimal - Text-only arrows (‹ and ›)
Arrow Position (Horizontal)
- Sides - Positioned at left and right edges of slider
- Inside - Positioned inside the slider content area
- Outside - Positioned outside the slider viewport (requires extra margin)
Arrow Position (Vertical)
- Top - Arrows positioned at top of slider
- Center - Arrows vertically centered (most common)
- Bottom - Arrows positioned at bottom of slider
Arrow Size
- Default: 48px
- Adjusts the size of arrow buttons
- Larger sizes are easier to click/tap on mobile
- Smaller sizes are more subtle for minimal designs
Arrow Padding
- Default: Auto
- Inner spacing inside arrow buttons
- Increase to make arrow hit area larger
- Useful for touch-friendly designs
Arrow Colors (in Styles tab > Color section)
- Arrow Icon Color - Color of the arrow symbol
- Arrow Background - Background color of arrow button
- Supports WordPress color palette
- Use contrast for better visibility
Show Dots
- Toggle: On/Off
- Default: On
- Displays pagination dots below (or above) the slider
- One dot per slide for direct navigation
Dot Style (when dots enabled)
- Default - Circular dots
- Lines - Horizontal line indicators
- Squares - Square indicators
Dot Position
- Bottom - Dots below the slider (most common)
- Top - Dots above the slider
Dot Color (in Styles tab > Color section)
- Color of the pagination dots
- Active dot uses higher opacity
- Inactive dots use lower opacity
Transition Effect
- Slide - Slides move horizontally (supports multiple slides per view)
- Fade - Slides fade in/out (forces 1 slide per view)
- Zoom - Slides zoom in/out (forces 1 slide per view)
Choosing Effects:
- Slide: Best for galleries, product carousels, multi-slide layouts
- Fade: Best for hero sections, image backgrounds, smooth transitions
- Zoom: Best for dramatic hero sections, featured content
Transition Duration
- Default: 0.5s (500ms)
- Range: 0.1s - 2s
- How long the transition animation takes
- Faster (0.2-0.3s): Snappy, responsive
- Standard (0.5s): Balanced, professional
- Slower (0.8-1s): Dramatic, emphasis
Transition Easing
- Ease - Gradual start and end (most natural)
- Ease In Out - Slow start and end, faster middle
- Ease In - Slow start, fast end
- Ease Out - Fast start, slow end
- Linear - Constant speed (mechanical feel)
Enable Auto-play
- Toggle: On/Off
- Default: Off
- Automatically advances slides after a set interval
- Only activates when slider is visible in viewport (performance optimization)
Auto-play Interval
- Default: 3000ms (3 seconds)
- Range: 1000ms - 10000ms
- Time between automatic slide transitions
- Recommended: 3-5 seconds for readable content
- Longer intervals for content-heavy slides
- Shorter intervals for simple images
Pause on Hover
- Toggle: On/Off
- Default: On
- Pauses auto-play when user hovers over slider
- Improves user experience by preventing unwanted transitions
- Recommended to keep enabled
Pause on Interaction
- Toggle: On/Off
- Default: On
- Stops auto-play permanently after user clicks, swipes, or drags
- Prevents annoying users who manually navigate
- Recommended to keep enabled
Loop
- Toggle: On/Off
- Default: On
- Enables infinite looping (from last slide back to first)
- When off, navigation stops at first/last slide
- Uses intelligent clone management for seamless transitions
Swipeable (Touch)
- Toggle: On/Off
- Default: On
- Enables touch swipe navigation on mobile/tablet
- Essential for mobile user experience
Draggable (Mouse)
- Toggle: On/Off
- Default: On
- Enables mouse drag navigation on desktop
- Provides intuitive interaction for desktop users
Free Mode
- Toggle: On/Off
- Default: Off
- Smooth scrolling without snap points
- Slider doesn't snap to slide positions
- Creates a "carousel" feel
- Best with multiple slides per view
Centered Slides
- Toggle: On/Off
- Default: Off
- Active slide is centered in the viewport
- Useful for highlighting the current slide
- Works well with 3+ slides per view
Mobile Breakpoint
- Default: 768px
- Range: 320px - 900px
- Below this screen width, uses mobile slides per view setting
- Standard mobile breakpoint is 768px (iPad portrait and smaller)
Tablet Breakpoint
- Default: 1024px
- Range: 768px - 1280px
- Below this width (and above mobile breakpoint), uses tablet slides per view
- Standard tablet breakpoint is 1024px (iPad landscape and smaller)
ARIA Label
- Default: "Image slider"
- Accessible label for screen readers
- Customize to describe your slider's content
- Examples: "Product showcase", "Team member carousel", "Testimonial slider"
Goal: Full-width hero section with rotating content
Setup:
- Set height to
80vhor use 16:9 aspect ratio - 1 slide per view on all devices
- Use Fade or Zoom effect for smooth transitions
- Enable auto-play (4-5 second interval)
- Enable pause on hover and interaction
- Add background images to each slide
- Center content vertically and horizontally
Tips:
- Use high-quality, optimized background images
- Keep text concise and readable
- Add overlay to slides for better text contrast
- Consider 3-5 slides maximum to avoid overwhelming users
Goal: Showcase multiple products with navigation
Setup:
- Desktop: 4 slides per view
- Tablet: 2 slides per view
- Mobile: 1 slide per view
- Use Slide effect
- Gap: 20-30px for card spacing
- Show arrows and dots
- Enable swipe and drag
- Loop enabled
Tips:
- Use consistent image sizes for all products
- Add pricing and "Add to Cart" buttons in each slide
- Consider auto-play with 5-6 second interval
- Use square or 3:2 aspect ratio for product images
Goal: Rotating customer testimonials
Setup:
- 1 slide per view (all devices)
- Use Fade effect for subtle transitions
- Height: Auto or 400-500px
- Auto-play enabled (6-8 second interval)
- Pause on interaction enabled
- Centered content
- Minimal arrow style or hide arrows
Tips:
- Include customer photo, quote, and attribution
- Use centered text alignment
- Add quotation marks or icons
- Limit to 5-8 testimonials for best impact
Goal: Browsable image collection
Setup:
- Desktop: 3-4 slides per view
- Tablet: 2 slides per view
- Mobile: 1 slide per view
- Use 1:1 or 4:3 aspect ratio
- Gap: 15-20px
- Circle arrow style
- Free mode enabled (optional for smooth scrolling)
- Centered slides enabled
Tips:
- Optimize images for web
- Use consistent aspect ratios
- Consider linking slides to full-size images or modals
- Dots may not be needed with many images
Goal: Featured blog posts or articles
Setup:
- Desktop: 3 slides per view
- Tablet: 2 slides per view
- Mobile: 1 slide per view
- Use Slide effect
- Height: 400-500px
- Show arrows and dots
- No auto-play (let users control)
- Loop enabled
Tips:
- Include featured image, title, excerpt, and CTA button
- Use card-style layout with background or border
- Consistent content length across slides
- Limit to 6-10 featured items
Goal: Full viewport background slider
Setup:
- 1 slide per view
- Height:
100vh - Use Fade effect
- Auto-play enabled (5-6 seconds)
- Hide dots, show minimal arrows
- Large overlay opacity for text readability
- Centered content alignment
Tips:
- Use high-resolution images (but optimize file size)
- Add dark overlay (50-80% opacity) for text contrast
- Keep slides to 3-5 maximum
- Ensure text is readable on all slides
Optimize Images:
- Compress images before uploading (use tools like TinyPNG, ShortPixel)
- Use appropriate image sizes (don't use 4K images for 500px slider)
- Consider lazy loading for sliders below the fold
- Use WebP format for better compression
Reduce Motion:
- The slider automatically respects
prefers-reduced-motionpreference - Users who disable animations see instant transitions
- Auto-play is automatically disabled for reduced motion users
Limit Slides:
- Keep total slides under 20 for best performance
- More slides = larger DOM = slower performance
- Consider pagination or filters for large collections
DO:
- Make navigation obvious (visible arrows/dots)
- Use auto-play sparingly (can be annoying)
- Provide pause controls for auto-play
- Ensure content is readable on all devices
- Test swipe/drag interactions on touch devices
- Use consistent slide heights
- Provide alternative navigation (arrows AND dots)
DON'T:
- Use very fast auto-play intervals (< 3 seconds)
- Hide all navigation controls
- Use too many slides (overwhelming)
- Mix wildly different content types
- Forget to test on mobile devices
- Use very long transition durations (> 1 second)
- Auto-play sliders with critical information
Slide Content:
- Keep text concise and scannable
- Use high-contrast text on backgrounds
- Include clear calls-to-action
- Maintain consistent visual hierarchy
- Test readability at all screen sizes
Accessibility:
- Add meaningful ARIA labels
- Ensure keyboard navigation works
- Test with screen readers
- Provide text alternatives for image-only slides
- Use sufficient color contrast
The Slider block is built with accessibility as a priority:
Keyboard Navigation:
-
Left Arrow- Previous slide -
Right Arrow- Next slide -
Home- Jump to first slide -
End- Jump to last slide -
Tab- Navigate between controls (arrows, dots)
Screen Reader Support:
-
role="region"with descriptive ARIA label - Each slide has
role="group"andaria-roledescription="slide" - Live region announces slide changes ("Slide 2 of 5")
- Inactive slides have
aria-hidden="true" - Navigation buttons have descriptive labels
Focus Management:
- Slider is keyboard focusable
- Current slide is in tab order
- Inactive slides are removed from tab order
- Focus indicators are visible
Reduced Motion:
- Respects
prefers-reduced-motionsystem preference - Disables transitions for motion-sensitive users
- Disables auto-play when reduced motion is preferred
When Creating Sliders:
-
Provide Descriptive ARIA Labels
- Customize ARIA label to describe slider purpose
- Examples: "Customer testimonials", "Featured products", "Photo gallery"
-
Ensure Keyboard Access
- Test all navigation with keyboard only
- Verify arrow keys work
- Ensure Tab key reaches all controls
-
Test with Screen Reader
- Verify slide changes are announced
- Check that slide count is communicated
- Ensure navigation labels are clear
-
Color Contrast
- Text must have 4.5:1 contrast ratio minimum
- Navigation controls must be visible
- Test with various color blindness simulations
-
Auto-play Considerations
- Provide pause button for auto-play
- Keep intervals long enough to read content (5+ seconds)
- Consider disabling auto-play for content-heavy sliders
Check:
- Slides exist - Slider needs at least one slide block inside
- JavaScript loaded - Check browser console for errors
- Theme compatibility - Some themes may have CSS conflicts
- Height setting - Ensure height or aspect ratio is set appropriately
- Content overflow - Check if slide content is too large for container
Common Fixes:
- Clear browser cache and reload
- Check for JavaScript console errors (F12)
- Temporarily disable other plugins to check for conflicts
- Increase slider height if content is cut off
Check:
- Arrows/Dots enabled - Verify in Slider Settings
- Multiple slides - Need at least 2 slides for navigation
- JavaScript errors - Check browser console
- Theme conflicts - Some themes override styles
Common Fixes:
- Ensure show arrows/dots is toggled on
- Add more slides (need minimum of 2)
- Check browser console for JavaScript errors
- Increase z-index if navigation is behind content
Remember:
- Auto-play only works when slider is visible in viewport
- Auto-play is disabled in the editor (test on frontend)
- Respects reduced motion preferences
- Stops after user interaction (if pause on interaction enabled)
Debug Steps:
- Save and preview page (auto-play disabled in editor)
- Scroll slider into view
- Wait for interval to elapse
- Check browser console for errors
- Verify auto-play is enabled in settings
Possible Causes:
- Images loading - Slider initializes before images load
- Height calculation - Fixed height not set
- CSS conflicts - Theme or plugin CSS interfering
Solutions:
- Set fixed height instead of auto
- Ensure images have width/height attributes
- Check for CSS conflicts in browser inspector
- Increase transition duration for smoother animations
Common Problems:
- Swipe not working - Ensure swipeable is enabled
- Arrows too small - Increase arrow size for mobile
- Content cut off - Adjust mobile slides per view
- Overlapping elements - Check z-index and positioning
Solutions:
- Enable swipeable in behavior settings
- Increase arrow size to 40px+ for better touch targets
- Set mobile slides per view to 1
- Test on actual devices, not just browser resize
If slider is slow:
- Too many slides - Reduce to 10-15 maximum
- Large images - Compress and optimize
- Complex content - Simplify slide content
- Multiple sliders - Limit sliders per page
Optimization:
- Compress images (use TinyPNG, ShortPixel)
- Use appropriate image dimensions
- Limit slides to 15-20 maximum
- Disable auto-play if not needed
- Remove unnecessary block gap/padding
Q: How many slides can I add? A: Technically unlimited, but keep under 20 for best performance. More slides means larger page size and slower rendering.
Q: Can I use videos in slides? A: Yes! Add a Video block or Embed block (YouTube, Vimeo) inside any slide. Be aware that videos increase page load time.
Q: Can I nest sliders (slider inside slider)? A: Not recommended. It creates poor UX and can cause conflicts. Use multiple separate sliders instead.
Q: Why does fade/zoom only show 1 slide? A: Fade and zoom effects only work with single slides. These effects fade/zoom the entire slide, so multiple slides per view isn't possible. Switch to slide effect for multi-slide view.
Q: How do I make slides the same height? A: Set a fixed height in Layout Settings (e.g., 500px) or use aspect ratio mode. This ensures all slides have consistent height.
Q: Can I customize arrow/dot appearance? A: Yes! Use the Color settings to change colors. For advanced customization, use the Custom CSS Extension or Additional CSS in Customizer.
Q: Does the slider work with page caching? A: Yes! The slider uses client-side JavaScript, so it works with all caching plugins.
Q: Can I link entire slides? A: While slides themselves aren't clickable, you can add a full-width/height link or button inside the slide content to achieve this effect.
Q: How do I disable navigation on mobile? A: You can hide arrows/dots with custom CSS for mobile devices. The slider will still work with swipe gestures.
Q: Can I control slider with custom JavaScript?
A: Yes! The slider dispatches custom events (dsgo-slider-change) that you can listen to. Access the slider instance via WeakMap if needed.
Q: Why is my auto-play not working? A: Auto-play is disabled in the editor (by design). Save and preview on the frontend to test. Also check that the slider is visible in the viewport and auto-play is enabled in settings.
Q: Can I use different transition effects for different slides? A: No, the transition effect applies to all slides in a slider. Create separate slider blocks if you need different effects.
Q: How do I create a full-width slider? A: Select the Slider block and in the toolbar, choose "Full Width" alignment. Or use the Align option in the block settings.
General Documentation:
Related Blocks:
- Slide Block - Individual slide configuration
Version 1.0.0 (2025-11-19)
- Initial release
- 3 transition effects (slide, fade, zoom)
- Responsive slides per view (desktop, tablet, mobile)
- Customizable navigation (arrows and dots)
- Auto-play with smart viewport detection
- Touch/drag support
- Infinite loop with clone management
- Keyboard navigation
- Full accessibility compliance (WCAG 2.1 AA)
- Reduced motion support
- Performance optimizations
Need Help?
- GitHub Issues - Report bugs
- GitHub Discussions - Ask questions
- Documentation - Full wiki
Last Updated: 2025-11-19 DesignSetGo v1.0.0 WordPress 6.4+
Auto-generated from
docs/blocks/SLIDER.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