{"id":22746045,"url":"https://github.com/hikouki/react-native-use-scroll-indicator","last_synced_at":"2026-04-28T11:33:27.849Z","repository":{"id":57341222,"uuid":"452919452","full_name":"hikouki/react-native-use-scroll-indicator","owner":"hikouki","description":"React hooks for ScrollView indicator of react-native.","archived":false,"fork":false,"pushed_at":"2022-01-31T02:08:09.000Z","size":1066,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-25T10:03:00.710Z","etag":null,"topics":["indicator","react-native","scroll"],"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/hikouki.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":"2022-01-28T02:55:07.000Z","updated_at":"2023-07-02T09:05:25.000Z","dependencies_parsed_at":"2022-09-01T20:33:00.681Z","dependency_job_id":null,"html_url":"https://github.com/hikouki/react-native-use-scroll-indicator","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hikouki%2Freact-native-use-scroll-indicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hikouki%2Freact-native-use-scroll-indicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hikouki%2Freact-native-use-scroll-indicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hikouki%2Freact-native-use-scroll-indicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hikouki","download_url":"https://codeload.github.com/hikouki/react-native-use-scroll-indicator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246277360,"owners_count":20751549,"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":["indicator","react-native","scroll"],"created_at":"2024-12-11T02:10:04.212Z","updated_at":"2026-04-28T11:33:22.804Z","avatar_url":"https://github.com/hikouki.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-use-scroll-indicator\n\nReact hooks for ScrollView indicator of react-native.\n\n## Installation\n\n```\nnpm install react-native-use-scroll-indicator\n```\n\n## Usage\n\nHorizontal Indicator.\n\n```tsx\nimport React from 'react';\nimport {Animated} from 'react-native';\nimport {HorizontalScrollIndicator} from 'react-native-use-scroll-indicator';\n\nexport default function Screen() {\n  ...\n\n  return (\n    \u003cHorizontalScrollIndicator scale={0.8}\u003e\n      {({ref, onLayout, onContentSizeChange, onScroll}) =\u003e (\n        \u003cAnimated.FlatList\n          horizontal\n          showsHorizontalScrollIndicator={false}\n          scrollEventThrottle={16}\n          ref={ref}\n          onLayout={onLayout}\n          onContentSizeChange={onContentSizeChange}\n          onScroll={onScroll}\n        /\u003e\n      )}\n    \u003c/HorizontalScrollIndicator\u003e\n  );\n}\n```\n\nVertical Indicator.\n\n```tsx\nimport React from 'react';\nimport {Animated} from 'react-native';\nimport {VerticalScrollIndicator} from 'react-native-use-scroll-indicator';\n\nexport default function Screen() {\n  ...\n\n  return (\n    \u003cVerticalScrollIndicator scale={0.8}\u003e\n      {({ref, onLayout, onContentSizeChange, onScroll}) =\u003e (\n        \u003cAnimated.FlatList\n          showsVerticalScrollIndicator={false}\n          scrollEventThrottle={16}\n          ref={ref}\n          onLayout={onLayout}\n          onContentSizeChange={onContentSizeChange}\n          onScroll={onScroll}\n        /\u003e\n      )}\n    \u003c/VerticalScrollIndicator\u003e\n  );\n}\n```\n\nWithout Component.\n\n```tsx\nimport React from 'react';\nimport {View, Animated} from 'react-native';\nimport {useScrollIndicator} from react-native-use-scroll-indicator';\n\nexport default function Screen() {\n  const {moveX, indicator, viewportSize, onLayout, onContentSizeChange, onScroll} =\n    useScrollIndicator();\n  const scale = 0.8;\n\n  return (\n    \u003cView\u003e\n      \u003cAnimated.FlatList\n        horizontal\n        showsHorizontalScrollIndicator={false}\n        scrollEventThrottle={16}\n        onLayout={onLayout}\n        onContentSizeChange={onContentSizeChange}\n        onScroll={onScroll}\n      /\u003e\n      \u003cView style={{\n        width: viewportSize.w * scale,\n        height: 8,\n        backgroundColor: '#333333',\n        borderRadius: 4,\n      }}\u003e\n        \u003cAnimated.View\n          style={[\n            {\n              backgroundColor: '#27BDB9',\n              height: '100%',\n              borderRadius: 4,\n            },\n            {\n              width: indicator.width * scale,\n              transform: [\n                {\n                  translateX: Animated.multiply(moveX, scale * indicator.sx),\n                },\n              ],\n            },\n          ]}\n        /\u003e\n      \u003c/View\u003e\n    \u003c/View\u003e\n  );\n}\n```\n\n## Interface\n\n### HorizontalScrollIndicator\n\n| Prop                    | Required | Type                  |\n|-------------------------|:--------:|-----------------------|\n| children                |    ☑️     | Function              |\n| containerStyle          |          | StyleProp\\\u003cViewStyle\u003e |\n| indicatorContainerStyle |          | StyleProp\\\u003cViewStyle\u003e |\n| indicatorStyle          |          | StyleProp\\\u003cViewStyle\u003e |\n| scale                   |          | number                |\n\n### VerticalScrollIndicator\n\n| Prop                    | Required | Type                  |\n|-------------------------|:--------:|-----------------------|\n| children                |    ☑️     | Function              |\n| containerStyle          |          | StyleProp\\\u003cViewStyle\u003e |\n| indicatorContainerStyle |          | StyleProp\\\u003cViewStyle\u003e |\n| indicatorStyle          |          | StyleProp\\\u003cViewStyle\u003e |\n| scale                   |          | number                |\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhikouki%2Freact-native-use-scroll-indicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhikouki%2Freact-native-use-scroll-indicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhikouki%2Freact-native-use-scroll-indicator/lists"}