enes

FlipView

A FlipView shows one item at a time, such as images or sections, and lets users flip through them with the buttons, swipes, the mouse wheel or the keyboard.

Landscape 1Landscape 2Landscape 3Landscape 4Landscape 5

Usage

<script>
  import { FlipView } from 'fluentui-svelte';
</script>

<FlipView aria-label="Landscapes" style="height: 14rem;">
  <img src="/one.jpg" alt="One" />
  <img src="/two.jpg" alt="Two" />
  <img src="/three.jpg" alt="Three" />
</FlipView>

Orientation

orientation flips the items horizontally (default) or vertically.

Landscape 1Landscape 2Landscape 3Landscape 4Landscape 5
horizontal
Landscape 1Landscape 2Landscape 3Landscape 4Landscape 5
vertical

Any content

Each direct child is an item: images, videos or whole sections.

Design

Fluent 2 tokens, materials and motion.

Build

Svelte 5 components with native forms.

Ship

Accessible by default, light and dark.

Selected item

Use bind:index to read or change the visible item.

Landscape 1Landscape 2Landscape 3Landscape 4Landscape 5

Keyboard and accessibility

Focus the FlipView and use the arrow keys, Home and End. Hidden items are inert. Name it with aria-label.

Component Props

NameTypeDefaultDescription
index bindablenumber0The index of the visible item.
orientation'horizontal' | 'vertical''horizontal'The direction the items flip in.
previousLabelstring'Previous'Accessible name of the previous button.
nextLabelstring'Next'Accessible name of the next button.
onIndexChange(index: number) => voidCalled when the visible item changes.
ref bindableHTMLDivElement | nullThe root element.
viewportRef bindableHTMLDivElement | nullThe element that holds and scrolls the items.
Element Attributes (div)
Edit this Doc View as Markdown