All Projects → oliviertassinari → React Swipeable Views

oliviertassinari / React Swipeable Views

Licence: mit
A React component for swipeable views. ❄️

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to React Swipeable Views

React Swipeable List
Swipeable list component for React.
Stars: ✭ 86 (-97.9%)
Mutual labels:  swipe, component
react-native-segment-control
Swipeable SegmentedControl component for React Native apps
Stars: ✭ 21 (-99.49%)
Mutual labels:  swipe, swipeable
React Swipeable Bottom Sheet
A swipeable material's bottom sheet implementation, using react-swipeable-views
Stars: ✭ 106 (-97.41%)
Mutual labels:  swipe, component
Swipeable-View
Simple editActionsForRowAt functionality, written on SWIFTUI
Stars: ✭ 37 (-99.1%)
Mutual labels:  swipe, swipeable
iron-swipeable-pages
[Polymer 1.x] Element that enables switching between different pages by swiping gesture.
Stars: ✭ 51 (-98.75%)
Mutual labels:  swipe, swipeable
Vue Picture Swipe
🖼 Vue Picture Swipe Gallery (a gallery of image with thumbnails, lazy-load and swipe) backed by photoswipe
Stars: ✭ 322 (-92.14%)
Mutual labels:  swipe, component
Nanocomponent
🚃 - create performant HTML components
Stars: ✭ 355 (-91.33%)
Mutual labels:  component
Next
🦍 A configurable component library for web built on React.
Stars: ✭ 4,045 (-1.22%)
Mutual labels:  component
Minui
基于规范的小程序 UI 组件库,自定义标签组件,简洁、易用、工具化
Stars: ✭ 3,512 (-14.24%)
Mutual labels:  component
Notifier
Sends notifications via one or more channels (email, SMS, ...).
Stars: ✭ 346 (-91.55%)
Mutual labels:  component
React Scrolllock
🔒 Prevent scroll on the <body />
Stars: ✭ 393 (-90.4%)
Mutual labels:  component
Vue Simple Spinner
A simple, flexible spinner for Vue.js
Stars: ✭ 385 (-90.6%)
Mutual labels:  component
Vue Tagsinput
A simple tags input with typeahead (autocomplete) built with Vue.js 2.
Stars: ✭ 375 (-90.84%)
Mutual labels:  component
For Editor
for-editor - A markdown editor based on React
Stars: ✭ 358 (-91.26%)
Mutual labels:  component
React Scrollspy
🔯 react scrollspy component
Stars: ✭ 382 (-90.67%)
Mutual labels:  component
Jigsaw
Jigsaw七巧板 provides a set of web components based on Angular5/8/9+. The main purpose of Jigsaw is to help the application developers to construct complex & intensive interacting & user friendly web pages. Jigsaw is supporting the development of all applications of Big Data Product of ZTE.
Stars: ✭ 354 (-91.36%)
Mutual labels:  component
React Infinite Calendar
✨ Infinite scrolling date-picker built with React, with localization, range selection, themes, keyboard support, and more.
Stars: ✭ 3,828 (-6.52%)
Mutual labels:  component
Liquor Tree
Tree component based on Vue.js
Stars: ✭ 348 (-91.5%)
Mutual labels:  component
Grouter Android
原名ActivityRouter,Android 页面及服务组件化框架
Stars: ✭ 375 (-90.84%)
Mutual labels:  component
Native
Generate a form using JSON Schema and Vue.js
Stars: ✭ 382 (-90.67%)
Mutual labels:  component

react-swipeable-views

A React component for swipeable views.

Package Version Download Size (kB gzipped)
react-swipeable-views npm version npm downloads 5.08
react-swipeable-views-utils npm version npm downloads 3.52
react-swipeable-views-native npm version npm downloads ?

Build Status Dependencies DevDependencies Donate TypeScript definitions on DefinitelyTyped Coverage Status

Documentation

Get started

Component API

More

Installation

Browser

npm install --save react-swipeable-views

Native (experimental)

npm install --save react-swipeable-views-native

The problem solved

Check out the demos from a mobile device (real or emulated). It's tiny (<10 kB gzipped), it quickly renders the first slide, then lazy-loads the others.

Simple example

usage

Browser

import React from 'react';
import SwipeableViews from 'react-swipeable-views';

const styles = {
  slide: {
    padding: 15,
    minHeight: 100,
    color: '#fff',
  },
  slide1: {
    background: '#FEA900',
  },
  slide2: {
    background: '#B3DC4A',
  },
  slide3: {
    background: '#6AC0FF',
  },
};

const MyComponent = () => (
  <SwipeableViews>
    <div style={Object.assign({}, styles.slide, styles.slide1)}>
      slide n°1
    </div>
    <div style={Object.assign({}, styles.slide, styles.slide2)}>
      slide n°2
    </div>
    <div style={Object.assign({}, styles.slide, styles.slide3)}>
      slide n°3
    </div>
  </SwipeableViews>
);

export default MyComponent;

Native (experimental)

react-native support is experimental and I have no plan pushing it forward. I start to think that lower level abstraction to share the implementation between the platforms are more appropriate. We have two different implementations of the react-swipeable-views API.

import React from 'react';
import {
  StyleSheet,
  Text,
  View,
} from 'react-native';

import SwipeableViews from 'react-swipeable-views-native';
// There is another version using the scroll component instead of animated.
// I'm unsure which one give the best UX. Please give us some feedback.
// import SwipeableViews from 'react-swipeable-views-native/lib/SwipeableViews.scroll';

const styles = StyleSheet.create({
  slideContainer: {
    height: 100,
  },
  slide: {
    padding: 15,
    height: 100,
  },
  slide1: {
    backgroundColor: '#FEA900',
  },
  slide2: {
    backgroundColor: '#B3DC4A',
  },
  slide3: {
    backgroundColor: '#6AC0FF',
  },
  text: {
    color: '#fff',
    fontSize: 16,
  },
});

const MyComponent = () => (
  <SwipeableViews style={styles.slideContainer}>
    <View style={[styles.slide, styles.slide1]}>
      <Text style={styles.text}>
        slide n°1
      </Text>
    </View>
    <View style={[styles.slide, styles.slide2]}>
      <Text style={styles.text}>
        slide n°2
      </Text>
    </View>
    <View style={[styles.slide, styles.slide3]}>
      <Text style={styles.text}>
        slide n°3
      </Text>
    </View>
  </SwipeableViews>
);

export default MyComponent;

Who's using react-swipeable-views?

License

This project is licensed under the terms of the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].