import * as React from 'react'; import { Carousel, Image } from '@fluentui/react-northstar'; const imageAltTags = { ade: 'Portrait of Ade', elliot: 'Portrait of Elliot', kristy: 'Portrait of Kristy', nan: 'Portrait of Nan', }; const carouselItems = [ { key: 'ade', id: 'ade', content: {imageAltTags.ade}, }, { key: 'elliot', id: 'elliot', content: {imageAltTags.elliot}, }, { key: 'kristy', id: 'kristy', content: {imageAltTags.kristy}, }, { key: 'nan', id: 'nan', content: {imageAltTags.nan}, }, ]; const CarouselExample = () => ( ({ key: index, 'aria-controls': item.id, 'aria-label': imageAltTags[item.id], })), }} items={carouselItems} getItemPositionText={(index: number, size: number) => `${index + 1} of ${size}`} /> ); export default CarouselExample;