You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 3 Next »
04 Jan 2023
Gabriel Weinberg
Adam Stankiewicz
Time
Item
Presenter
Notes
15-20 minutes
Building carousel-like UI components
There are several existing use cases for carousels on edx.org, the Enterprise MFEs, and maybe more?
Examples:
Proposal:
Create a re-usable pattern for implementing carousel-like UI components.
useOverflowScroll
Encapsulates the business logic related to carousel-like UI components.
Ensures the overflow container element has the appropriate a11y attribute(s) and styles.
OverflowScroll
Calls the above React hook and wraps (most of) its return values in a React context such that the component’s children have access to the hook values.
children
OverflowScroll.Items
A helper component that ensures each child element receives the class name .pgn__overflow-scroll-item
.pgn__overflow-scroll-item
Why? useOverflowScroll falls back to querying for that class name to derive the list of children elements.
CardCarousel
Composes OverflowScroll and CardDeck to implement a carousel for Card components with custom controls as a standalone, importable component.
CardDeck
Card
ChipCarousel
Composes OverflowScroll and Chip (only provided as an example on the documentation website, for now).
Chip
Notes:
.