Skip to main content

Horizontal scroller

Use cases:

  • Presenting many sections of data to the user that they can scroll through.
  • Alternative to typical dragging of a scrollbar to navigate through content. Uses buttons (fliipers) instead.

Example

Card number 1A buttonCard number 2A buttonCard number 3A buttonCard number 4A buttonCard number 5A buttonCard number 6A buttonCard number 7A buttonCard number 8A buttonCard number 9A buttonCard number 10A buttonCard number 11A buttonCard number 12A button

Declaration

<rapid-horizontal-scroll></rapid-horizontal-scroll>

Usage

@customElement({
name: 'my-element',
template: html`
<rapid-horizontal-scroll>
<rapid-card>
Card number 1
<rapid-button>A button</rapid-button>
</rapid-card>
<rapid-card>
Card number 2
<rapid-button>A button</rapid-button>
</rapid-card>
</rapid-horizontal-scroll>
`,
})
export class MyElement extends GenesisElement {
}
tip

You can use any html content inside of the scroll component, you don't have to use <rapid-card>s.

API

Property and attribute binding examples for Genesis Component syntax. Closing tag omitted.

Attributes

NameTypeDescriptionExample
speednumberSpeed of scroll in pixels per second. Default: 600
<rapid-horizontal-scroll speed="750">
durationstringThe CSS time value for the scroll transition duration. Overrides the speed attribute. When duration is set, the speed attribute has no effect.
<rapid-horizontal-scroll duration="300">
easing"linear" | "ease-in" | "ease-out" | "ease-in-out" | stringThe easing value of the scroll. Default "ease-out"
<rapid-horizontal-scroll easing="ease-in">
flippers-hidden-from-atbooleanWhether the flippers are hidden from assistive technology. Default: false
<rapid-horizontal-scroll flippers-hidden-from-at>
view"default" | "mobile"View for this component. Default: default
<rapid-horizontal-scroll view="mobile">

Properties

This component doesn't have any properties which are not also controlled via attributes.

Slots

NameDescription
DefaultWhere the content to be scrolled is placed
startContent which can be provided before the scroll area
endContent which can be provided after the scroll area

Parts

NameDescription
scroll-areaWraps the entire scrollable region.
scroll-viewThe visible scroll area.
content-containerThe container for the content.
scroll-prevThe previous flipper container.
scroll-action-previousThe element wrapping the previous flipper.
scroll-nextThe next flipper container.
scroll-action-nextThe element wrapping the next flipper.

Events fired

NameDescription
scrollstartFires a custom 'scrollstart' event when scrolling
scrollendFires a custom 'scrollend' event when scrolling stops

Events listened to

This component doesn't listen to any events.