Banner
The Banner component is a versatile UI element used for displaying multiple important announcements, promotions in a horizontally scrollable format. It typically appears at the top or bottom of an app
Last updated
npm install @questlabs/react-native-sdk// Types
type DataItem = {
id: number;
image: string | any;
};import { Banner } from "@questlabs/react-native-sdk";import { SafeAreaView, StyleSheet } from "react-native";
import React from "react";
import { Banner } from "@questlabs/react-native-sdk";
export default function App() {
return (
<SafeAreaView style={styles.container}>
<Banner
imageStyle={{ width: 400, height: 200 }}
data={[
{
id: "1",
image:
"https://cdn.pixabay.com/photo/2018/03/21/07/16/learning-3245793_1280.jpg",
},
{
id: "2",
image:
"https://cdn.pixabay.com/photo/2018/03/21/07/16/learning-3245793_1280.jpg",
},
{
id: "3",
image:
"https://cdn.pixabay.com/photo/2018/03/21/07/16/learning-3245793_1280.jpg",
},
{
id: "4",
image:
"https://cdn.pixabay.com/photo/2018/03/21/07/16/learning-3245793_1280.jpg",
},
{
id: "5",
image:
"https://cdn.pixabay.com/photo/2018/03/21/07/16/learning-3245793_1280.jpg",
},
{
id: "6",
image:
"https://cdn.pixabay.com/photo/2018/03/21/07/16/learning-3245793_1280.jpg",
},
]}
/>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "lightgray",
justifyContent: "center",
},
});