{"id":26556784,"url":"https://github.com/skrivle/react-inverted-scrollview","last_synced_at":"2026-03-15T20:41:11.155Z","repository":{"id":65484749,"uuid":"137658222","full_name":"skrivle/react-inverted-scrollview","owner":"skrivle","description":"Easily support inverted scrolling. Maintains a correct scroll position when new content is added.","archived":false,"fork":false,"pushed_at":"2019-08-09T11:44:21.000Z","size":222,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T06:03:07.498Z","etag":null,"topics":["infinite-scroll","inverted","react","scroll","scrollview","ui"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skrivle.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-17T13:46:55.000Z","updated_at":"2023-03-10T10:53:13.000Z","dependencies_parsed_at":"2023-01-25T18:46:26.145Z","dependency_job_id":null,"html_url":"https://github.com/skrivle/react-inverted-scrollview","commit_stats":null,"previous_names":["vejersele/react-inverted-scrollview"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Freact-inverted-scrollview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Freact-inverted-scrollview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Freact-inverted-scrollview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skrivle%2Freact-inverted-scrollview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skrivle","download_url":"https://codeload.github.com/skrivle/react-inverted-scrollview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244952243,"owners_count":20537463,"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":["infinite-scroll","inverted","react","scroll","scrollview","ui"],"created_at":"2025-03-22T11:34:05.660Z","updated_at":"2025-10-28T12:09:12.711Z","avatar_url":"https://github.com/skrivle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/vejersele/react-inverted-scrollview.svg?branch=master)](https://travis-ci.org/vejersele/react-inverted-scrollview)\n\n# React Inverted ScrollView\n\nEasily support inverted scrolling in for example chat apps. Maintains a correct scroll position when new content is added.\n\n## Installation:\n\n```\nnpm install react-inverted-scrollview --save\n```\n\n## Example:\n\n```javascript\nimport _ from 'lodash';\nimport React, { Component } from 'react';\nimport ScrollView from 'react-inverted-scrollview';\n\nclass MyComponent extends Component {\n    state = {\n        messages: _.range(30).map(index =\u003e ({\n            id: index,\n            text: `message-${index}`\n        }))\n    };\n\n    scrollToBottom() {\n        if (!this.scrollView) return;\n        this.scrollView.scrollToBottom();\n    }\n\n    scrollToTop() {\n        if (!this.scrollView) return;\n        this.scrollView.scrollToTop();\n    }\n\n    handleScroll = ({ scrollTop, scrollBottom }) =\u003e {\n        console.log('scrollTop', scrollTop);\n        console.log('scrollBottom', scrollBottom);\n    };\n\n    render() {\n        const { messages } = this.state;\n        return (\n            \u003cScrollView\n                width={400}\n                height={400}\n                ref={ref =\u003e (this.scrollView = ref)}\n                onScroll={this.handleScroll}\n            \u003e\n                {messages.map(message =\u003e \u003cdiv key={message.id}\u003e{message.text}\u003c/div\u003e)}\n            \u003c/ScrollView\u003e\n        );\n    }\n}\n```\n\n## API\n\n### Props\n\n| Prop                          | Type                                                       | Default  |\n| ----------------------------- | ---------------------------------------------------------- | -------- |\n| width                         | number                                                     | 100      |\n| height                        | number                                                     | 100      |\n| onScroll                      | (info: { scrollBottom: number, scrollTop: number }) =\u003e any | () =\u003e {} |\n| style                         | Object {}                                                  | {}       |\n| restoreScrollPositionOnUpdate | boolean                                                    | true     |\n| children                      | React.Node or ({restoreScrollPosition}) =\u003e Node            | Node     |\n\n### Instance methods\n\n```javascript\ninstance.scrollToBottom();\ninstance.scrollToTop();\ninstance.setScrollBottom(value);\ninstance.setScrollTop(value);\ninstance.restoreScrollPosition();\n```\n\n## Check out the examples:\n\n```\ngit clone https://github.com/vejersele/react-inverted-scrollview.git\ncd react-inverted-scrollview\nnpm install\nnpm run storybook\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskrivle%2Freact-inverted-scrollview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskrivle%2Freact-inverted-scrollview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskrivle%2Freact-inverted-scrollview/lists"}