Skip to content

docs(react-carousel): Add autoplayInterval control to Autoplay story#35756

Open
Copilot wants to merge 5 commits intomasterfrom
copilot/update-carousel-autoplay-example
Open

docs(react-carousel): Add autoplayInterval control to Autoplay story#35756
Copilot wants to merge 5 commits intomasterfrom
copilot/update-carousel-autoplay-example

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Update Carousel Autoplay Example to Include autoplayInterval Prop

Resolves the issue where the Autoplay example didn't clearly demonstrate how to use the autoplayInterval prop.

  • Analyze the current Carousel Autoplay example implementation
  • Add a control to demonstrate the autoplayInterval prop
  • Update the example to pass the autoplayInterval to the Carousel component
  • Verify the changes work correctly with manual testing
  • Update story documentation
  • Run tests and linting (all passed)
  • Address code review feedback
  • Run security checks (no issues found)
  • Add change file as requested

Changes Made

  1. Added Input control for autoplayInterval prop in the Autoplay example

    • Allows users to set custom autoplay interval in milliseconds
    • Includes a helpful hint showing "Delay between slides: {value}ms"
    • Defaults to 4000ms (matching the default prop value)
    • Input validation ensures values >= 1000ms (aligned with min attribute)
  2. Connected the interval control to the Carousel component by passing the autoplayInterval prop

  3. Updated story documentation to explain the autoplayInterval prop and its default value

  4. Added beachball change file for tracking this documentation update

Screenshot

Carousel Autoplay Example

The updated example now clearly demonstrates:

  • How to use the autoplayInterval prop
  • Real-time feedback showing the current interval value
  • Interactive control to test different interval values

Testing & Validation

Build: Passed - yarn nx run react-carousel:build
Linting: Passed - yarn nx run react-carousel:lint
Tests: All 203 tests passed - yarn nx run react-carousel:test
Manual verification: Autoplay advances slides at the specified interval (tested with 2000ms)
Code review: Feedback addressed (validation aligned with min attribute)
Security: No issues found - CodeQL analysis
Change file: Created for @fluentui/react-carousel

Security Summary

No security vulnerabilities were introduced or found in this change. This is a documentation-only change to a Storybook example.

Original prompt

This section details on the original issue you should resolve

<issue_title>Update the Carousel Autoplay example to include autoplayInterval prop</issue_title>
<issue_description>### Component

Carousel

Package version

latest

React version

19

Environment

System:
    OS: macOS 26.3
    CPU: (16) arm64 Apple M3 Max
    Memory: 16.01 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 145.0.7632.76
    Edge: 145.0.3800.58
    Safari: 26.3
  npmPackages:
    @fluentui/react-icons: ^2.0.306 => 2.0.311 
    @fluentui/react-icons-northstar: 0.66.5 => 0.66.5 
    @fluentui/react-northstar: 0.66.5 => 0.66.5 
    @types/react: 19.2.2 => 19.2.2 
    @types/react-dom: 19.2.2 => 19.2.2 
    react: 19.2.0 => 19.2.0 
    react-dom: 19.2.0 => 19.2.0

Current Behavior

The autoplay example doesn’t clearly demonstrate how to use the autoplayInterval prop, and because it’s not linked to the autoplay button, it causes confusion for users.

Expected Behavior

The autoplay example clearly demonstrates how to set the interval at which the carousel slides are displayed.

Reproduction

https://stackblitz.com/edit/bpbcbk5d?file=src%2Fexample.tsx

Steps to reproduce

N/A

Are you reporting an Accessibility issue?

None

Suggested severity

Low - Has or doesn't need a workaround

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 17, 2026 16:42
Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
…bute

Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Carousel Autoplay example with autoplayInterval prop feat(react-carousel): Add autoplayInterval control to Autoplay story Feb 17, 2026
Copilot AI requested a review from dmytrokirpa February 17, 2026 16:44
@dmytrokirpa
Copy link
Contributor

@copilot add change file by running yarn change

Copilot AI and others added 2 commits February 18, 2026 08:23
Co-authored-by: dmytrokirpa <1492102+dmytrokirpa@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 18, 2026

@copilot add change file by running yarn change

Change file created for @fluentui/react-carousel with type "none" (documentation update). See commit a362d72.

@dmytrokirpa dmytrokirpa marked this pull request as ready for review February 18, 2026 12:39
@dmytrokirpa dmytrokirpa requested review from a team and Mitch-At-Work as code owners February 18, 2026 12:39
@dmytrokirpa dmytrokirpa changed the title feat(react-carousel): Add autoplayInterval control to Autoplay story docs(react-carousel): Add autoplayInterval control to Autoplay story Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the Carousel Autoplay example to include autoplayInterval prop

2 participants

Comments