1.0.1 • Published 3 years ago

react-native-card-carousel-animated v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Screenshots

How To Use

Install

npm i react-native-card-carousel-animated

Import

import Carousel from 'react-native-card-carousel-animated';

Examples

Simple

const data: Props['cards'] = [
	{
		id: 'ad3',
		title: '6',
		subtitle: 'Apples',
		child: (
			<View style={{ backgroundColor: 'lightgreen', flex: 1, alignItems: 'center', justifyContent: 'center' }}>
				<Text style={{ fontSize: 22 }}>Hello World</Text>
			</View>
		),
	},
	{
		id: 'ad5',
		title: '10',
		subtitle: 'Grapes',
		child: (
			<View style={{ backgroundColor: 'purple', flex: 1, alignItems: 'center', justifyContent: 'center' }}>
				<Text style={{ fontSize: 22 }}>Hello World</Text>
			</View>
		),
	},
	{
		id: 'ad6',
		title: '2',
		subtitle: 'Bananas',
		child: (
			<View style={{ backgroundColor: 'yellow', flex: 1, alignItems: 'center', justifyContent: 'center' }}>
				<Text style={{ fontSize: 22 }}>Hello World</Text>
			</View>
		),
	},
];

export default function App() {
	return (
		<View
			style={{
				height: 400,
				backgroundColor: 'white',
			}}>
			<View style={{ height: 50 }}></View>
			<Carousel cards={data} />
		</View>
	);
}

API

carousel Object

Prop NameDescriptionTyperequired
cardsList of card objectsArray true
rtlFlagRevert side for rtl languagesbooleanfalse

Card Object

Prop NameDescriptionTyperequired
idThe id of the cardstringtrue
titleCard titlestringtrue
subtitleCard subtitlestringtrue
childComponent that will render below the cardJSX.Elementtrue
titleStyleTitle text styleTextStylefalse
subtitleStyleSubtitle text styleTextStylefalse

Supported

Tested on Android and IOS with expo sdk 41