react-scrollable-list

WebJar for react-scrollable-list

Лицензия

Лицензия

MIT
Категории

Категории

React Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

react-scrollable-list
Последняя версия

Последняя версия

1.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

react-scrollable-list
WebJar for react-scrollable-list
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jwarning/react-scrollable-list

Скачать react-scrollable-list

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/react-scrollable-list/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>react-scrollable-list</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/react-scrollable-list/
implementation 'org.webjars.npm:react-scrollable-list:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/react-scrollable-list/
implementation ("org.webjars.npm:react-scrollable-list:1.1.3")
'org.webjars.npm:react-scrollable-list:jar:1.1.3'
<dependency org="org.webjars.npm" name="react-scrollable-list" rev="1.1.3">
  <artifact name="react-scrollable-list" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='react-scrollable-list', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "react-scrollable-list" % "1.1.3"
[org.webjars.npm/react-scrollable-list "1.1.3"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

React Scrollable List

npm version

React Scrollable List is a scrollable, high-performance list component for rendering large lists of items with React. It's performance really shines when dealing with lists in excess of a thousand items, and scales well into the millions or more. Due to it only rendering a small slice of the list into the DOM at any time based on the scroll position, it removes most of the speed issues with web browsers and rendering very large amounts of DOM nodes at once.

Demo

jwarning.github.io/react-scrollable-list

The component is generic and renders a simple component comprised of a div wrapper and div containers for each of the elements currently rendered.

To style the elements you can simply refer to the .react-scrollable-list and the .react-scrollable-list-item classes. The list items need to be passed in via props in the following format:

{
  id: 'a unique identifier',
  content: 'the content to display inside the div'
}

The content can alternatively also be another react component.

The component takes up to four props:

  • listItems: an array of items in the format specified above
  • heightOfItem: the CSS height of each item (needs to be the same for each item)
  • maxItemsToRender: an optional number which tells the component how many components before and after the item scrolled to it should pre-render
  • style: an optional style object to add inline styling through JS
<ReactScrollableList
  listItems=[...]
  heightOfItem={30}
  maxItemsToRender={50}
  style={{ color: '#333' }}
/>

Notes

To build a CommonJS version of this file simply run npm run build. A build is already included in the dist folder.

License

MIT

Версии библиотеки

Версия
1.1.3