Skip to content

Feature Request: Add a Carousel component #2861

Description

@suxiaoshao

Description

Add a reusable Carousel component for presenting a sequence of content panels with previous and next navigation.

GPUI Component currently provides scrolling, lists, tabs, pagination, and animation infrastructure, but it does not provide a content carousel with item selection, snapping, and carousel-specific navigation state.

Proposed scope

  • Carousel root and state API
  • Composable content and item parts
  • Previous and next controls with disabled boundary states
  • Controlled and programmatic current-index navigation
  • Horizontal and vertical orientations
  • Optional looping
  • Pointer or trackpad dragging with item snapping
  • Keyboard navigation
  • Selection/change events
  • Reduced-motion handling and accessibility labels

Pagination indicators can be composed from existing controls or exposed as an optional part without coupling Carousel to one visual treatment.

Reference

The implementation should use GPUI-native scrolling and motion behavior rather than introducing a web carousel dependency.

Acceptance criteria

  • Public component and state API following existing builder conventions
  • Story covering horizontal, vertical, looped, controlled, and keyboard-operated examples
  • English documentation in website/docs/components/
  • Chinese documentation in website/zh-CN/docs/components/
  • Focused tests for navigation boundaries, looping, selection changes, and state transitions

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions