Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fluentui/react-carousel

Package Overview
Dependencies
Maintainers
12
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentui/react-carousel

A composable carousel component that enables pagination with minimal rerenders

  • 9.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
increased by6.28%
Maintainers
12
Weekly downloads
 
Created
Source

React Carousel components for Fluent UI React

A Carousel is a sliding viewport that enables a list of tab panels to be hidden offscreen while still remaining accessible via rotating controls or keyboard interactions.

For full screen banners, hidden cards will be set to inert and can be accessed via the underlying nav controls (prev/next/pagination), while smaller responsive CarouselCards can be explored with keyboard navigation (left/right arrow keys) and group focus (Enter/Esc) to void lengthy tabIndex sequences.

The React Carousel uses direct DOM manipulation to ensure that state can be updated without driving a react render cycle of the CarouselCards themselves, users may subscribe to visibility event callbacks or activeIndex supplied via context for updating local state on carousel movement.

A CarouselAnnouncer class is provided that will announce page changes when context is updated for accessibility users.

Sample Code

<Carousel groupSize={1} circular>
  <CarouselSlider>
    {Cards.map((card, index) => (
      <CarouselCard key={`image-${index}`} index={index}>
        Card {index + 1}
      </CarouselCard>
    ))}
  </CarouselSlider>
  <CarouselNavContainer next={{ 'aria-label': 'go to next' }} prev={{ 'aria-label': 'go to prev' }}>
    <CarouselNav>{index => <CarouselNavButton aria-label={`Carousel Nav Button ${index}`} />}</CarouselNav>
  </CarouselNavContainer>
  <CarouselAnnouncer>
    {(currentIndex, totalSlides, _slideGroupList) => {
      return `Slide ${currentIndex + 1} of ${totalSlides}`;
    }}
  </CarouselAnnouncer>
</Carousel>

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc