Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

React Native Image Slider

import React from 'react';
import { StatusBar, StyleSheet, View } from 'react-native';
import { SliderBox } from 'react-native-image-slider-box';

const App = () => {
    const [images, setImages] = React.useState([
        "https://source.unsplash.com/1024x768/?nature",
        "https://source.unsplash.com/1024x768/?water",
        "https://source.unsplash.com/1024x768/?tree",
    ]);

    return (
        <View style={styles.container}>
            <SliderBox 
                images={images}
                sliderBoxHeight={400}
                dotColor="#FFEE58"
                inactiveDotColor="#90A4AE"  
                onCurrentImagePressed={index => console.warn(`image ${index} pressed`)}
                paginationBoxVerticalPadding={20}
                autoplay
                circleLoop
            />
            <StatusBar />
        </View>
    );
}

const styles = StyleSheet.create({
    container: {
        backgroundColor: 'white',
        paddingTop: 10,
        flex: 1,
    },
});

export default App;
Comment

react native intro slider

import React from 'react';
import Icon from 'react-native-vector-icons/Ionicons';
import { StyleSheet, View } from 'react-native';
import AppIntroSlider from 'react-native-app-intro-slider';
 
const styles = StyleSheet.create({
  buttonCircle: {
    width: 40,
    height: 40,
    backgroundColor: 'rgba(0, 0, 0, .2)',
    borderRadius: 20,
    justifyContent: 'center',
    alignItems: 'center',
  },
  //[...]
});
 
// slides = [...]
 
export default class App extends React.Component {
  _renderItem = ({ item }) => {
    return (
      <View style={styles.slide}>
        <Text style={styles.title}>{item.title}</Text>
        <Image source={item.image} />
        <Text style={styles.text}>{item.text}</Text>
      </View>
    );
  }
  _renderNextButton = () => {
    return (
      <View style={styles.buttonCircle}>
        <Ion
          name="md-arrow-round-forward"
          color="rgba(255, 255, 255, .9)"
          size={24}
        />
      </View>
    );
  };
  _renderDoneButton = () => {
    return (
      <View style={styles.buttonCircle}>
        <Ion
          name="md-checkmark"
          color="rgba(255, 255, 255, .9)"
          size={24}
        />
      </View>
    );
  };
  render() {
    return (
      <AppIntroSlider
        data={slides}
        renderDoneButton={this._renderDoneButton}
        renderNextButton={this._renderNextButton}
      />
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: pre selected data-grid material-ui 
Javascript :: javascript delete element of an array 
Javascript :: send json by curl 
Javascript :: fetch in vue 3 
Javascript :: react native stepper 
Javascript :: work with query string javascript 
Javascript :: post requests javascript 
Javascript :: for ... of ... 
Javascript :: javascript for...in loop 
Javascript :: JavaScript - HTML DOM Methods 
Javascript :: exports in node js 
Javascript :: js object delete value by key 
Javascript :: belongstomany sequelize 
Javascript :: how to add comment in javascript 
Javascript :: react animation 
Javascript :: how to get data from multiple tables mongoose 
Javascript :: react using object as prop 
Javascript :: how to check if a variable is true or false in javascript 
Javascript :: how to append an element to an array in javascript 
Javascript :: window.innerwidth 
Javascript :: javascript join 2 variables into string 
Javascript :: what is cross browser testing 
Javascript :: generator js 
Javascript :: new line in textarea javascript 
Javascript :: javascript test throw error 
Javascript :: change size of font awesome icon react 
Javascript :: google app script 
Javascript :: node.js modules 
Javascript :: react datetime mannual editing 
Javascript :: how to delete props from url 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =