Mark Mara

Mark Mara

1592272320

A tiny but mighty list virtualization library, with zero dependencies

react-tiny-virtual-list

A tiny but mighty list virtualization library, with zero dependencies

  • Tiny & dependency free – Only 3kb gzipped
  • Render millions of items, without breaking a sweat
  • Scroll to index or set the initial scroll offset
  • Supports fixed or variable heights/widths
  • Vertical or Horizontal lists

Check out the demo for some examples, or take it for a test drive right away in Code Sandbox.

Getting Started

Using npm:

npm install react-tiny-virtual-list --save

ES6, CommonJS, and UMD builds are available with each distribution. For example:

import VirtualList from 'react-tiny-virtual-list';

You can also use a global-friendly UMD build:

<script src="react-tiny-virtual-list/umd/react-tiny-virtual-list.js"></script>
<script>
var VirtualList = window.VirtualList;
...
</script>

Example usage

import React from 'react';
import {render} from 'react-dom';
import VirtualList from 'react-tiny-virtual-list';

const data = ['A', 'B', 'C', 'D', 'E', 'F', ...];

render(
  <VirtualList
    width='100%'
    height={600}
    itemCount={data.length}
    itemSize={50} // Also supports variable heights (array or function getter)
    renderItem={({index, style}) =>
      <div key={index} style={style}> // The style property contains the item's absolute position
        Letter: {data[index]}, Row: #{index}
      </div>
    }
  />,
  document.getElementById('root')
);

Prop Types

Property Type Required? Description
width Number String* âś“
height Number String* âś“
itemCount Number âś“ The number of items you want to render
renderItem Function ✓ Responsible for rendering an item given it’s index: ({index: number, style: Object}): React.PropTypes.node. The returned element must handle key and style.
itemSize âś“ Either a fixed height/width (depending on the scrollDirection), an array containing the heights of all the items in your list, or a function that returns the height of an item given its index: (index: number): number
scrollDirection String Whether the list should scroll vertically or horizontally. One of 'vertical' (default) or 'horizontal'.
scrollOffset Number Can be used to control the scroll offset; Also useful for setting an initial scroll offset
scrollToIndex Number Item index to scroll to (by forcefully scrolling if necessary) x
scrollToAlignment String Used in combination with scrollToIndex, this prop controls the alignment of the scrolled to item. One of: 'start', 'center', 'end' or 'auto'. Use 'start' to always align items to the top of the container and 'end' to align them bottom. Use 'center’ to align them in the middle of the container. 'auto' scrolls the least amount possible to ensure that the specified scrollToIndex item is fully visible.
stickyIndices Number[] An array of indexes (eg. [0, 10, 25, 30]) to make certain items in the list sticky (position: sticky)
overscanCount Number Number of extra buffer items to render above/below the visible items. Tweaking this can help reduce scroll flickering on certain browsers/devices.
estimatedItemSize Number Used to estimate the total size of the list before all of its items have actually been measured. The estimated total height is progressively adjusted as items are rendered.
onItemsRendered Function Callback invoked with information about the slice of rows/columns that were just rendered. It has the following signature: ({startIndex: number, stopIndex: number}).
onScroll Function Callback invoked whenever the scroll offset changes within the inner scrollable region. It has the following signature: (scrollTop: number, event: React.UIEvent<HTMLDivElement>).

* Width may only be a string when scrollDirection is 'vertical'. Similarly, Height may only be a string if scrollDirection is 'horizontal'

Public Methods

recomputeSizes (index: number)

This method force recomputes the item sizes after the specified index (these are normally cached).

VirtualList has no way of knowing when its underlying data has changed, since it only receives a itemSize property. If the itemSize is a number, this isn’t an issue, as it can compare before and after values and automatically call recomputeSizes internally. However, if you’re passing a function to itemSize, that type of comparison is error prone. In that event, you’ll need to call recomputeSizes manually to inform the VirtualList that the size of its items has changed.

Common Issues with PureComponent

react-tiny-virtual-list uses PureComponent, so it only updates when it’s props change. Therefore, if only the order of your data changes (eg ['a','b','c'] => ['d','e','f']), react-tiny-virtual-list has no way to know your data has changed and that it needs to re-render.

You can force it to re-render by calling forceUpdate on it or by passing it an extra prop that will change every time your data changes.

Reporting Issues

Found an issue? Please report it along with any relevant details to reproduce it. If you can, please provide a live demo replicating the issue you’re describing. You can fork this Code Sandbox as a starting point.

Contributions

Feature requests / pull requests are welcome, though please take a moment to make sure your contributions fits within the scope of the project. Learn how to contribute

Acknowledgments

This library draws inspiration from react-virtualized, and is meant as a bare-minimum replacement for the List component. If you’re looking for a tiny, lightweight and dependency-free list virtualization library that supports variable heights, you’re in the right place! If you’re looking for something that supports more use-cases, I highly encourage you to check out react-virtualized instead, it’s a fantastic library

Download Details:

Author: clauderic

Live Demo: https://clauderic.github.io/react-tiny-virtual-list/

GitHub: https://github.com/clauderic/react-tiny-virtual-list

#react #reactjs #javascript #react-js

What is GEEK

Buddha Community

A tiny but mighty list virtualization library, with zero dependencies
Mark Mara

Mark Mara

1592272320

A tiny but mighty list virtualization library, with zero dependencies

react-tiny-virtual-list

A tiny but mighty list virtualization library, with zero dependencies

  • Tiny & dependency free – Only 3kb gzipped
  • Render millions of items, without breaking a sweat
  • Scroll to index or set the initial scroll offset
  • Supports fixed or variable heights/widths
  • Vertical or Horizontal lists

Check out the demo for some examples, or take it for a test drive right away in Code Sandbox.

Getting Started

Using npm:

npm install react-tiny-virtual-list --save

ES6, CommonJS, and UMD builds are available with each distribution. For example:

import VirtualList from 'react-tiny-virtual-list';

You can also use a global-friendly UMD build:

<script src="react-tiny-virtual-list/umd/react-tiny-virtual-list.js"></script>
<script>
var VirtualList = window.VirtualList;
...
</script>

Example usage

import React from 'react';
import {render} from 'react-dom';
import VirtualList from 'react-tiny-virtual-list';

const data = ['A', 'B', 'C', 'D', 'E', 'F', ...];

render(
  <VirtualList
    width='100%'
    height={600}
    itemCount={data.length}
    itemSize={50} // Also supports variable heights (array or function getter)
    renderItem={({index, style}) =>
      <div key={index} style={style}> // The style property contains the item's absolute position
        Letter: {data[index]}, Row: #{index}
      </div>
    }
  />,
  document.getElementById('root')
);

Prop Types

Property Type Required? Description
width Number String* âś“
height Number String* âś“
itemCount Number âś“ The number of items you want to render
renderItem Function ✓ Responsible for rendering an item given it’s index: ({index: number, style: Object}): React.PropTypes.node. The returned element must handle key and style.
itemSize âś“ Either a fixed height/width (depending on the scrollDirection), an array containing the heights of all the items in your list, or a function that returns the height of an item given its index: (index: number): number
scrollDirection String Whether the list should scroll vertically or horizontally. One of 'vertical' (default) or 'horizontal'.
scrollOffset Number Can be used to control the scroll offset; Also useful for setting an initial scroll offset
scrollToIndex Number Item index to scroll to (by forcefully scrolling if necessary) x
scrollToAlignment String Used in combination with scrollToIndex, this prop controls the alignment of the scrolled to item. One of: 'start', 'center', 'end' or 'auto'. Use 'start' to always align items to the top of the container and 'end' to align them bottom. Use 'center’ to align them in the middle of the container. 'auto' scrolls the least amount possible to ensure that the specified scrollToIndex item is fully visible.
stickyIndices Number[] An array of indexes (eg. [0, 10, 25, 30]) to make certain items in the list sticky (position: sticky)
overscanCount Number Number of extra buffer items to render above/below the visible items. Tweaking this can help reduce scroll flickering on certain browsers/devices.
estimatedItemSize Number Used to estimate the total size of the list before all of its items have actually been measured. The estimated total height is progressively adjusted as items are rendered.
onItemsRendered Function Callback invoked with information about the slice of rows/columns that were just rendered. It has the following signature: ({startIndex: number, stopIndex: number}).
onScroll Function Callback invoked whenever the scroll offset changes within the inner scrollable region. It has the following signature: (scrollTop: number, event: React.UIEvent<HTMLDivElement>).

* Width may only be a string when scrollDirection is 'vertical'. Similarly, Height may only be a string if scrollDirection is 'horizontal'

Public Methods

recomputeSizes (index: number)

This method force recomputes the item sizes after the specified index (these are normally cached).

VirtualList has no way of knowing when its underlying data has changed, since it only receives a itemSize property. If the itemSize is a number, this isn’t an issue, as it can compare before and after values and automatically call recomputeSizes internally. However, if you’re passing a function to itemSize, that type of comparison is error prone. In that event, you’ll need to call recomputeSizes manually to inform the VirtualList that the size of its items has changed.

Common Issues with PureComponent

react-tiny-virtual-list uses PureComponent, so it only updates when it’s props change. Therefore, if only the order of your data changes (eg ['a','b','c'] => ['d','e','f']), react-tiny-virtual-list has no way to know your data has changed and that it needs to re-render.

You can force it to re-render by calling forceUpdate on it or by passing it an extra prop that will change every time your data changes.

Reporting Issues

Found an issue? Please report it along with any relevant details to reproduce it. If you can, please provide a live demo replicating the issue you’re describing. You can fork this Code Sandbox as a starting point.

Contributions

Feature requests / pull requests are welcome, though please take a moment to make sure your contributions fits within the scope of the project. Learn how to contribute

Acknowledgments

This library draws inspiration from react-virtualized, and is meant as a bare-minimum replacement for the List component. If you’re looking for a tiny, lightweight and dependency-free list virtualization library that supports variable heights, you’re in the right place! If you’re looking for something that supports more use-cases, I highly encourage you to check out react-virtualized instead, it’s a fantastic library

Download Details:

Author: clauderic

Live Demo: https://clauderic.github.io/react-tiny-virtual-list/

GitHub: https://github.com/clauderic/react-tiny-virtual-list

#react #reactjs #javascript #react-js

Virtual Sports Betting Software Development | Virtual Sports Betting Solutions

Mobiweb Technologies offers extensive Virtual Sports Betting Software solutions that includes a variety of sports like Football, Horse racing, Golf, Tennis etc. on which bettors can place wager. Team focuses on realistic animation creation that enhances the user-experience. This kind of special feature attracts fans from different regions and brings a large amount of betting options. With a dedicated team of sports betting software developers, it is possible for us to design customized and engaging betting softwares, the only difference from real-betting is that users can bet online at any time by just one click.

#virtual sports betting software #virtual sports betting app development #virtual sports betting app developers #virtual sports betting software developers #virtual sports betting website developers

robiul hasan

robiul hasan

1626095071

Buy Mobile Database & Build Phone Number List

We provide Buy Mobile Database,cell phone number list, mobile number databae,
cold calling list, mobile number list, phone number list, SMS campaign list,
SMS marketing list, telemarketing list, fax lists, country email list, b2b email list, c-level executive list, job function email list. Our all database is 95% accurate cleaned and updated. view our website: http://www.mobiledatabase.club
This is image title

#cell phone number list #cold calling list #mobile number database #mobile number list #phone number list #sms campaign list

robiul hasan

robiul hasan

1624649955

Business Phone List | Consumer Phone Lists | Buy Mobile Database

We all need a reason to smile right now. Even though it’s neither Christmas nor Halloween, it’s still the time to have fun. April Fool’s Day is coming! So, you’d better start thinking out practical jokes already. The Buy Mobile Database upcoming Laughter day offers businesses the Austria Business Phone List opportunity to generate their online Phone Number List awareness with hoaxes and original mischief. Want to be in the loop this year and pull it off? Various examples of April Fool’s day sale campaigns from globally-known brands are on the table today.

Love it or hate, the 500-year tradition of pulling someone’s leg will carry on. In a business niche as well. But you should Build Phone Number List REALLY walk on eggshells here. Any joke will fall flat if it doesn’t hit a chord with your audience. That’s why I provide you with these comic April Fool’s day marketing ideas many brands have brought. Enjoy! 1. Play the fool wisely Phone Number List April Fool’s Day marketing campaign by HelpCrunch Not every business risks its reputation and mocks itself. If a good Buy Mobile Database sense of humor, self-deprecation, and an excellent imagination are synonymous to you, take the following April Fool’s marketing endeavor into account. We at HelpCrunch know how to cheer you up this April 1st and show ourselves in a more fun light. Our team crafted this rib-tickler, cool, and absolutely one-of-a-kind alternative April Fool’s day homepage. Yes, we can laugh at ourselves in a professional and quick-witted manner

Let me walk you through our main name of the game. Every business strives to be serious-minded and rather formal. Marketing tries to highlight the product or service is unique and just…perfect. But here’s a twist: an ideal product does not exist. That’s Buy Austria Business Phone Numbers List why we made up Phone Number List our mind to tell you about our downsides upfront and honest, exaggerate them, and laugh. We may not be ideal, though we’re sincere and funny. Hopefully, customers will appreciate our sense of humor. We’ve spent 5 years building this platform…It’s still not even close to what we’ve imagined” – this is where the pun is totally intended. The team modified the content throughout the page in keeping with the best April Fools’ day marketing Phone Number List traditions. For instance, the CTA “Start 14-day free trial” is now changed to “Sign up and live dangerously” and the hero section has our team’s witty quotes. This is image title

If you Phone Number List like the idea and want to implement it with your brand, make sure you know exactly where the sweet spot is. Do as we do. For those who don’t feel like giggling and prefer rather serious air, there is Cell Phone Numebr list the “MAKE ME LAUGH” switch on our off-the-wall home page. Spread the word and celebrate Laughter day with HelpCrunch! 2. Announce a fake product April Fool’s marketing ideas are impossible to imagine Contact Us without the one from McDonald’s. These Phone Number List guys are real tricksters when it comes to this holiday. McDonald’s clearly understands its audience. The fast-food chain presented special “Sauce pots” several years ago. These were mini milkshakes for those who like dipping their fries in something sweet.

#telemarketing list #sms campaign list #phone number list #cell phone number list #mobile number database

Top Virtual Event Streaming App Development Services in USA

AppClues Infotech is one of the leading mobile app development company in USA that develops secured on-demand virtual event streaming applications for multiple platforms (Android & iOS) and various Industries. We have a dedicated team of designers and developers that are highly proficient to make any type of custom mobile application as per your specific needs.

If you have any ideas for virtual event streaming app development kindly share them with us to get the right solution for your dream project.

For more info:
Website: https://www.appcluesinfotech.com/
Email: info@appcluesinfotech.com
Call: +1-978-309-9910

#top virtual event streaming app development services in usa #how to build virtual event application #cost and features in virtual events app development #how much does it cost to make a virtual live streaming app #virtual event streaming app development #online event app development