Coder Social home page Coder Social logo

asvrada / react-segmented-picker Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 956 KB

An iOS style segmented picker for react web

Home Page: https://www.npmjs.com/package/react-segmented-picker

HTML 35.54% JavaScript 15.99% SCSS 3.20% Shell 0.27% TypeScript 45.00%

react-segmented-picker's Introduction

react-segmented-picker

Build Status

An iOS style segmented picker for react web

Install

npm i react styled-components --save-dev
npm i react-segmented-picker

or

yarn add react styled-components -D
yarn add react-segmented-picker

Usage

import React, { useState } from 'react';

import SegmentedPicker from 'react-segmented-picker';

// Demo App
function App() {
  const [selection, setSelection] = useState(0);
  const options = ['Apple', 'Orange', 'Pear', 'Watermelon'];

  return (
    <div className="App">
      <p>You selected</p>
      <p>#{selection}: {options[selection]}</p>

      <SegmentedPicker
        options={options}
        selection={selection}
        onSelectionChange={(newSelection) => {
          setSelection(newSelection);
        }}
      />
    </div>
  );
}

export default App;

react-segmented-picker's People

Contributors

asvrada avatar

Stargazers

 avatar

Watchers

 avatar

react-segmented-picker's Issues

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.