Skip to content

feat: Implement Material 3 carousel component#114

Draft
treeder wants to merge 1 commit into
mainfrom
feature-material-3-carousel-12307278285894705633
Draft

feat: Implement Material 3 carousel component#114
treeder wants to merge 1 commit into
mainfrom
feature-material-3-carousel-12307278285894705633

Conversation

@treeder
Copy link
Copy Markdown
Member

@treeder treeder commented May 12, 2026

This PR implements the missing Material 3 Carousel components (md-carousel and md-carousel-item).
It follows modern web component standards using Lit and uses CSS scroll-snap for smooth horizontal scrolling, matching the uncontained carousel variant defined in Material Design 3 guidelines.
The components are fully integrated into the library exports (all.js and common.js) and have been visually verified for correct layout and scrolling behavior. ARIA roles are integrated out-of-the-box using ElementInternals for improved accessibility.


PR created automatically by Jules for task 12307278285894705633 started by @treeder

Adds `md-carousel` and `md-carousel-item` components based on Material 3 guidelines.
- `md-carousel` serves as an uncontained scrolling container leveraging flexbox and CSS `scroll-snap-type: x mandatory`.
- `md-carousel-item` implements individual items with `scroll-snap-align: start`.
- Components correctly wire accessibility ARIA roles `list` and `listitem` via ElementInternals.
- Updates `all.js` and `common.js` to include the new components.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Carousel component consisting of Carousel and CarouselItem LitElements, along with their respective exports in all.js and common.js. The review feedback highlights a need to improve the accessibility of the Carousel container by adding keyboard focusability and an explicit aria-orientation attribute.

Comment thread carousel/carousel.js
Comment on lines +6 to +7
this.internals = this.attachInternals()
this.internals.role = 'list'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The carousel container is scrollable but lacks keyboard focusability, which prevents users who rely on arrow keys from navigating the content. Additionally, explicitly setting the aria-orientation helps assistive technologies correctly interpret the component's layout.

    this.internals = this.attachInternals()
    this.internals.role = 'list'
    this.internals.ariaOrientation = 'horizontal'
    this.tabIndex = 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant