{"id":14974381,"url":"https://github.com/ale-vncs/roll-picker-native","last_synced_at":"2025-10-27T08:31:23.619Z","repository":{"id":53490475,"uuid":"350506658","full_name":"ale-vncs/roll-picker-native","owner":"ale-vncs","description":"An interactive alternative to Picker.","archived":false,"fork":false,"pushed_at":"2021-03-28T18:13:41.000Z","size":1342,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-30T07:29:07.139Z","etag":null,"topics":["android","ios","react","react-native","react-native-app","roll-picker","roll-picker-native","scroll","scrollview"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ale-vncs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-22T22:22:56.000Z","updated_at":"2024-01-26T12:07:42.000Z","dependencies_parsed_at":"2022-08-18T21:22:36.833Z","dependency_job_id":null,"html_url":"https://github.com/ale-vncs/roll-picker-native","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ale-vncs%2Froll-picker-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ale-vncs%2Froll-picker-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ale-vncs%2Froll-picker-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ale-vncs%2Froll-picker-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ale-vncs","download_url":"https://codeload.github.com/ale-vncs/roll-picker-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238463789,"owners_count":19476774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","ios","react","react-native","react-native-app","roll-picker","roll-picker-native","scroll","scrollview"],"created_at":"2024-09-24T13:50:29.073Z","updated_at":"2025-10-27T08:31:22.102Z","avatar_url":"https://github.com/ale-vncs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n![GitHub](https://img.shields.io/github/license/ale-vncs/roll-picker-native)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n![npm](https://img.shields.io/npm/v/roll-picker-native)\n\n# roll-picker-native\n\nAn interactive alternative to Picker.\n\nThe `roll-picker-native` is just a way better to see a Picker with some customizations.\n\n### Examples\n![Example 1](.github/images/example_1.gif)\n![Example 2](.github/images/example_2.gif)\n\n### Install\n\n`yarn add roll-picker-native`\n\n`npm install roll-picker-native`\n\n`expo install roll-picker-native`\n\n### Basic Usage\n\nImport `roll-picker-native`\n\n````js\nimport RollPickerNative from 'roll-picker-native'\n````\n\n```js\n\u003cRollPickerNative\n  items={['item1', 'item2', 'item3', 'item4', 'item5']}\n  index={month}\n  onIndexChange={(index: number) =\u003e console.log('month', index)}\n/\u003e\n```\n\n#### Code sample\n\n````js\nimport React, { useCallback, useState } from 'react'\nimport RollPickerNative from 'roll-picker-native'\nimport { Text, View } from 'react-native'\n\nconst App = () =\u003e {\n  const days = Array.from({ length: 30 }, (_, i) =\u003e (i + 1).toString())\n  const years = Array.from({ length: 30 }, (_, i) =\u003e {\n    if (i \u003c 9) return '200' + (i + 1).toString()\n    return '20' + (i + 1).toString()\n  })\n\n  const months = [\n    'January',\n    'February',\n    'March',\n    'May',\n    'April',\n    'June',\n    'July',\n    'August',\n    'September',\n    'October',\n    'November',\n    'December'\n  ]\n  const [year, setYear] = useState(0)\n  const [month, setMonth] = useState(0)\n  const [day, setDay] = useState(0)\n\n  const handleRoll = useCallback((field: string, index: number) =\u003e {\n    switch (field) {\n      case 'month': {\n        setMonth(index)\n        break\n      }\n      case 'day': {\n        setDay(index)\n        break\n      }\n      case 'year': {\n        setYear(index)\n        break\n      }\n    }\n  }, [])\n\n  return (\n    \u003cView\n      style={{\n        flex: 1,\n        justifyContent: 'center',\n        alignItems: 'center',\n        paddingHorizontal: 15,\n        backgroundColor: '#e5e5e5'\n      }}\n    \u003e\n      \u003cView\n        style={{\n          width: '100%',\n          flexDirection: 'row'\n        }}\n      \u003e\n        \u003cRollPickerNative\n          items={months}\n          index={month}\n          onIndexChange={(index: number) =\u003e handleRoll('month', index)}\n          selectHeight={35}\n          containerHeight={250}\n          selectTextStyle={{\n            fontSize: 22\n          }}\n        /\u003e\n        \u003cRollPickerNative\n          items={days}\n          index={day}\n          onIndexChange={(index: number) =\u003e handleRoll('day', index)}\n          selectHeight={35}\n          containerHeight={250}\n          selectTextStyle={{\n            fontSize: 22\n          }}\n        /\u003e\n        \u003cRollPickerNative\n          items={years}\n          index={year}\n          onIndexChange={(index: number) =\u003e handleRoll('year', index)}\n          selectHeight={35}\n          containerHeight={250}\n          selectTextStyle={{\n            fontSize: 22\n          }}\n        /\u003e\n      \u003c/View\u003e\n      \u003cText\n        style={{\n          paddingVertical: 25,\n          fontSize: 20,\n          fontWeight: 'bold'\n        }}\n      \u003e\n        {months[month]}/{days[day]}/{years[year]}\n      \u003c/Text\u003e\n    \u003c/View\u003e\n  )\n}\n\nexport default App\n\n````\n### Props\n\n| Name            | Type                    | Default      | Description                         |\n|-----------------|-------------------------|--------------|-------------------------------------|\n| items           | string[]                | **Required** | Items of roll picker                |\n| label           | string                  | undefined    | Label title of component            |\n| labelStyle      | TextStyle               | undefined    | Style of label                      |\n| index           | number                  | **Required** | index of roll picker                |\n| onIndexChange   | (index: number) =\u003e null | undefined    | Return index when scroll is stopped |\n| containerHeight | number                  | 200          | Height of container                 |\n| selectHeight    | number                  | 20           | Height of item and box select       |\n| itemStyle       | ViewStyle               | undefined    | Style of items not selected         |\n| itemTextStyle   | TextStyle               | undefined    | Style of text each item             |\n| selectStyle     | ViewStyle               | undefined    | Style of item selected              |\n| selectTextStyle | TextStyle               | undefined    | Style text of item selected         |\n| lineColor       | ViewStyle.borderColor   | 'white'      | Color of border top and bottom      |\n| removeLine      | boolean                 | false        | Remove border top and bottom        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fale-vncs%2Froll-picker-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fale-vncs%2Froll-picker-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fale-vncs%2Froll-picker-native/lists"}