Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A 60fps React slider/carousel component with modular styles, autoplay, captioned images, and fullpage navigation for Next.js and Gatsby.
React Awesome Slider is a 60fps React slider/carousel component for media and content transitions, created by Rafael Caferati and published as the npm package @rcaferati/react-awesome-slider under the MIT license. It renders slides from either React children or a media array, and ships with optional higher-order components for autoplay, captioned images, and animated lettering, plus fullpage navigation utilities for single-page applications. The library is designed for React 18 and newer, and its repository also documents use with Next.js and Gatsby.
React Awesome Slider is a React component that displays a set of slides as an animated slider or carousel. It accepts slides as React children using data-src attributes or as a media array of objects carrying source and optional slug fields, and outputs a navigable, swipeable slider with configurable transition animations. The component runs on React 18 or newer, with react-dom >= 18 as a peer dependency, and the project is maintained by Rafael Caferati on GitHub.
sideAnimation plus five extra animation stylesheets: cubeAnimation, fallAnimation, foldOutAnimation, openAnimation, and scaleOutAnimation, each imported as its own CSS file.--organic-arrow-color, --control-bullet-color, and --content-background-color, overrideable inline through the style prop.cssModule prop accepts a module map or an array of maps, allowing bundlers to map class names while the corresponding .css files are still imported for side effects.mobileTouch prop (on by default) enables swipe gestures on touch devices, with next/previous buttons and clickable bullets as fallbacks.withAutoplay wraps the slider and adds play, cancelOnInteraction, and interval props to rotate slides automatically.withCaptionedImages consumes a screens array of media, caption, and backgroundColor objects and overlays captions on slides.navigation subpath exports Provider, Link, withNavigationHandlers, and withNavigationContext to keep slider selection in sync with URL routes in SPAs.onFirstMount, onTransitionStart, onTransitionEnd, onTransitionRequest, and onTransitionReject, each receiving a getInfo() payload with slides, currentIndex, currentMedia, currentSlide, and element.media or children modes to display images or custom content in a swipeable slider without writing transition logic from scratch.fillParent prop for fullscreen, fullpage transitions in hero sections.media array with preloaded images and use the onLoadStart hook for custom preload behavior.Yes, it is open source under the MIT license, and the npm package can be used in commercial and personal projects without a paid license.
The package lists react >= 18 and react-dom >= 18 as peer dependencies, so it requires React 18 or newer.
Import withCaptionedImages from the captioned subpath and pass a screens array where each item includes media, caption, and optionally backgroundColor. The HOC overlays the caption text on the slide.
Yes, the mobileTouch prop is enabled by default and the slider responds to swipe gestures on touch screens. It can be disabled by setting the mobileTouch prop to false.
The recommended way is to override CSS variables passed through the style prop on the slider root, such as --organic-arrow-color, --control-bullet-color, and --content-background-color. Additional built-in animations require importing their own CSS file.