Skip to main content

Flipper

Flippers are styled buttons that point left and right so that users can move horizontally backwards and forwards through sequential blocks of content. They also enable users to see exactly where they are in the sequence.

Flippers are often a supplemental form of navigation, so they are hidden by default to avoid duplicate keyboard interaction. Passing an attribute of aria-hidden="false" will expose the flippers to assistive technology.

Use cases:

  • creating a UI to page through collections of ui elements
  • creating buttons to move through different pages

Example

Declaration

<rapid-flipper></rapid-flipper>

Usage

@customElement({
name: 'my-element',
template: html<MyElement>`
<rapid-flipper @click="${(x) => x.onPreviousClick()}" direction="previous"></rapid-flipper>
<rapid-flipper @click="${(x) => x.onNextClick()}" direction="next"></rapid-flipper>
`,
})
export class MyElement extends GenesisElement {
onPreviousClick() {
console.log('previous');
}

onNextClick() {
console.log('next');
}
}

API

Attributes

AttributeTypeDescriptionExample
disabledbooleanDisable the flipper. When disabled, it will not respond to clicks.
<rapid-flipper disabled>
aria-hiddenbooleanIndicates the flipper should be hidden from assistive technology. Because flippers are often supplementary navigation, they are often hidden from assistive technology. Default: true
<rapid-flipper aria-hidden="false">
direction"previous" | "next"Sets which way the flipper points. "previous" points left and "next" points right. Default: next.
<rapid-flipper direction="previous">

Properties

The properties of this component are all controlled via attributes.

Slots

SlotDescription
nextThe next flipper content.
previousThe previous flipper content.

Parts

PartDescription
nextWraps the next flipper content.
previousWraps the previous flipper content.

Events fired

EventTypeDescriptionExample
clickEvent & KeyboardEventFired when Enter or Space is invoked via keyboard and the flipper is exposed to assistive technologies.
<rapid-flipper @click="${(x,ctx) => x.onFlipperClick(ctx.event)}">

Events listened to

This component doesn't listen to any events.