GithubHelp home page GithubHelp logo

yasaricli / react-native-dots-pagination Goto Github PK

View Code? Open in Web Editor NEW
136.0 7.0 36.0 4.87 MB

A simple dot paging for React Native.

Home Page: https://www.npmjs.com/package/react-native-dots-pagination

License: MIT License

JavaScript 40.14% Starlark 9.98% Java 13.67% Ruby 14.46% Objective-C 21.75%
react react-native pagination dots

react-native-dots-pagination's Introduction

react-native-dots-pagination

Paging as dots for react-native.

Quickstart

yarn add react-native-dots-pagination

Using

import React, { Component } from 'react';
import Dots from 'react-native-dots-pagination';


class Example extends Component {
  constructor(props) {
    super(props);
    this.state = {
      active: 0
    }
  }
  
  render() {
    return (
      <Dots length={10} active={this.state.active} />
    )
  }
}

Props

Name Default value Description
length 10 Required. The amount of dots you want to use.
active 1 Required. The index of the currently active dot.
width 300 The overall width works like a center.
paddingVertical 10 Average Vertical padding.
paddingHorizontal 10 Average Horizontal padding.
passiveDotWidth 10 (Width, Height) for passive dot.
activeDotWidth 15 (Width, Height) for active dot.
passiveDotHeight 10 Height for passive dot.
activeDotHeight 15 Height for active dot.
passiveColor #CCCCCC Colors for passive dots.
activeColor #016bd8 Colors for active dots.
marginHorizontal ย 2 To adjust Margin Horizontal
onScrollTo function Trigger when scrolls and index changes

Issues

Github Issues are used to track todos, bugs, feature requests, and more.

react-native-dots-pagination's People

Contributors

alexanderhodes avatar ib3n avatar meatnordrink avatar mstrk avatar sixpathdev avatar vdor avatar yasaricli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-dots-pagination's Issues

[Suggestion] Style Prop

For custom styling.

I want to have position: 'absolute' so i can place it wherever i want

declaration file for expo

Hi,

Thanks for the grateful plugin.

I'm new for React Native Expo, may I know how to solve this error message:
"Could not find a declaration file for module 'react-native-dots-pagination'. 'd:/expo/hkslbrowser/node_modules/react-native-dots-pagination/index.js' implicitly has an 'any' type."

Thanks a lot.

Document: marginHorizontal

First, thanks for sharing this control.

An improvement that would allow me to match the design of the pager on iOS, would be to allow to specify the spacing between dots.

Problem sliding to next dots.

Hello there, yesterday I found your module and I implemented it in our app. But here is the problem.
I have around 70 items and for some reason when I scroll to the 8th item suddenly the scrollView does not scroll right and instead of that it actually vanishes and then I have to do few scrolls to make the scrollView scroll to the item again. Do you have any idea what could be the cause of it ?

I recorded how it look when it happens. Please help me guys :D I am really lost here.
https://streamable.com/3ulyyq

Accessibility props not passed through

Many approaches to creating an accessible carousel require making the dots accessible and clickable. This is messier than it needs to be currently, because the <Dots> component does not accept/pass-through accessibility props, so doing so requires adding an extra wrapping <View>.

I've opened a PR to fix this issue - #21.

Dots don't scroll to the active one on render.

Replicate
Expected Behavior:
The pagination dots container within our app's AppCarousel component should scroll to the active item when the component renders, ensuring that the active item is visible within the dots container.

Actual Behavior:
The dots container does not scroll to the active item on render if it is further than the visible dots, requiring a manual swipe to trigger the scroll animation.

Additional Information:

This issue affects the user experience within our app, as it does not provide a clear indication of the current active item.
The issue can be reproduced consistently when the active item is set before rendering.

Environment:

React Native

Bug for activeHeight < 15 and length = 2

Hi,

When length is set to 2 (width,height=15), then the right dot is clipped, as shown in the image.
Screen Shot 2020-06-20 at 11 24 41 AM

Setting width, height to match the default for non-active (width,height=10), makes the dot offset in the Y.
Screen Shot 2020-06-20 at 11 24 00 AM

componentWillReceiveProps is not recommended for use.

When using Dots in a react-native app, the following warning now display:
YellowBox.js:71 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

This could be changed to use componentDidUpdate() instead and still have the desired effects.

Cannot find variable styles

After installing in my react native application, I keep getting an error saying cannot find variable styles. I made a fix for it though

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.