Skip to main content

Flipper

Flippers are styled buttons which can be used to indicate moving through blocks of content.

As flippers are often a supplemental form of navigation, the flippers 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:

  • Create a UI to page through collections of ui elements
  • Create 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, if disabled it will not respond to click.
<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"The direction that the flipper implies navigating. Default: next
<rapid-flipper direction="previous">

Properties

This component doesn't have any properties that are not also 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.