UNPKG

react-native-reanimated-carousel

Version:

Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.

2 lines 1.74 kB
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Basic=void 0;var _reactNative=require("react-native");var _react=_interopRequireDefault(require("react"));var _PaginationItem=require("./PaginationItem");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-reanimated-carousel/react-native-reanimated-carousel/src/components/Pagination/Basic/index.tsx";var Basic=function Basic(props){var activeDotStyle=props.activeDotStyle,dotStyle=props.dotStyle,progress=props.progress,_props$horizontal=props.horizontal,horizontal=_props$horizontal===void 0?true:_props$horizontal,data=props.data,size=props.size,containerStyle=props.containerStyle,renderItem=props.renderItem,_onPress=props.onPress,carouselName=props.carouselName;if(typeof size==="string"||typeof(dotStyle==null?void 0:dotStyle.width)==="string"||typeof(dotStyle==null?void 0:dotStyle.height)==="string")throw new Error("size/width/height must be a number");return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[{justifyContent:"space-between",alignSelf:"center"},horizontal?{flexDirection:"row"}:{flexDirection:"column"},containerStyle],children:data.map(function(item,index){return(0,_jsxRuntime.jsx)(_PaginationItem.PaginationItem,{index:index,size:size,count:data.length,dotStyle:dotStyle,animValue:progress,horizontal:!horizontal,activeDotStyle:activeDotStyle,onPress:function onPress(){return _onPress==null?void 0:_onPress(index);},accessibilityLabel:`Slide ${index+1} of ${data.length} - ${carouselName}`,children:renderItem==null?void 0:renderItem(item,index)},index);})});};exports.Basic=Basic; //# sourceMappingURL=index.js.map