Coder Social home page Coder Social logo

trendingtechnology / react-native-switch-selector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from app2sales/react-native-switch-selector

0.0 3.0 0.0 217 KB

Home Page: https://www.npmjs.com/package/react-native-switch-selector

JavaScript 100.00%

react-native-switch-selector's Introduction

SwitchSelector

Switch Selector to React Native.

npm version downloads

SwitchSelector

SwitchSelector

SwitchSelector - Custom Example

SwitchSelector

Installing

yarn add react-native-switch-selector

or

npm i react-native-switch-selector --save

Usage

import SwitchSelector from 'react-native-switch-selector';
const options = [
    { label: '01:00', value: '1' },
    { label: '01:30', value: '1.5' },
    { label: '02:00', value: '2' }
];
<SwitchSelector options={options} initial={0} onPress={value => console.log(`Call onPress with value: ${value}`)} />

Props

Prop Type Default Required Note
options array null true Items array to render. Each item has a label and a value and optionals icons
options[].label string null true Label from each item
options[].value string null true Value from each item
options[].customIcon Jsx element ou Function null false Optional custom icon from each item
options[].imageIcon string null false Source from a image icon form each item. Has the same color then label in render
options[].activeColor string null false Color from each item when is selected
initial number 0 true Item selected in initial render
onPress function console.log true Callback function called after change value.
fontSize number null false Font size from labels. If null default fontSize of the app is used.
selectedColor string '#fff' false Color text of the item selected
buttonColor string '#BCD635' false Color bg of the item selected
textColor string '#000' false Color text of the not selecteds items
backgroundColor string '#ffffff' false Color bg of the component
borderColor string '#c9c9c9' false Border Color of the component
hasPadding bool false false Indicate if item has padding
animationDuration number 250 false Duration of the animation

Authors

Contribute

Contributions are always welcome! Create a new Pull Request

react-native-switch-selector's People

Contributors

avishayil avatar jkdrangel avatar lucianomlima avatar patlux avatar

Watchers

 avatar  avatar  avatar

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.