OverflowScroll
Leave feedbackA set of React components that encapsulates the logic from useOverflowScroll for building carousel-like UI components:
OverflowScrollOverflowScroll.Items
Sample Usage
The following example demonstrates how to use OverflowScroll and OverflowScroll.Items to build carousel-like UI components.
Any Paragon component or export may be added to the code example.
Theme Variables (SCSS)#
$overflow-scroll-opacity-mask-transparent: var(--pgn-overflow-scroll-opacity-mask-transparent) !default;
Props API#
- ariaLabel
stringRequiredText describing the OverflowScroll for screen readers
- children
nodeRequiredSpecifies the content of the
OverflowScroll. - childQuerySelector
stringA CSS query selector to find all child elements within the overflow container.
- hasInteractiveChildren
boolDefaultfalseWhether the child
OverflowScrollcomponents are interactive/focusable. If not, atabindex="0"is added to be a11y-compliant - disableScroll
boolDefaultfalseWhether users can scroll within the overflow container.
- disableOpacityMasks
boolDefaultfalseWhether the default opacity masks should be shown at the start/end, if applicable.
- onScrollPrevious
funcCallback function for when the user scrolls to the previous element.
- onScrollNext
funcCallback function for when the user scrolls to the next element.
- offset
string|number - offsetTypeDefault'percentage'
enum'percentage' | 'fixed'