Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-virtual-scroller

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-virtual-scroller

Smooth scrolling for any amount of data

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
160K
decreased by-21.2%
Maintainers
1
Weekly downloads
 
Created

What is vue-virtual-scroller?

vue-virtual-scroller is a Vue.js component that allows for efficient rendering of large lists and grids by only rendering the visible items. This helps in improving performance and reducing memory usage.

What are vue-virtual-scroller's main functionalities?

Dynamic List Rendering

This feature allows for rendering a large list of items efficiently by only rendering the items that are currently visible. The `RecycleScroller` component is used to achieve this.


<template>
  <RecycleScroller
    :items="items"
    :item-size="50"
    key-field="id"
  >
    <template #default="{ item, index }">
      <div class="item">
        {{ item.name }}
      </div>
    </template>
  </RecycleScroller>
</template>

<script>
import { RecycleScroller } from 'vue-virtual-scroller'

export default {
  components: {
    RecycleScroller
  },
  data() {
    return {
      items: Array.from({ length: 1000 }).map((_, i) => ({ id: i, name: `Item ${i}` }))
    }
  }
}
</script>

Dynamic Grid Rendering

This feature allows for rendering a large grid of items efficiently by only rendering the items that are currently visible. The `DynamicScrollerGrid` component is used to achieve this.


<template>
  <DynamicScrollerGrid
    :items="items"
    :min-item-size="100"
    key-field="id"
  >
    <template #default="{ item, index }">
      <div class="item">
        {{ item.name }}
      </div>
    </template>
  </DynamicScrollerGrid>
</template>

<script>
import { DynamicScrollerGrid } from 'vue-virtual-scroller'

export default {
  components: {
    DynamicScrollerGrid
  },
  data() {
    return {
      items: Array.from({ length: 1000 }).map((_, i) => ({ id: i, name: `Item ${i}` }))
    }
  }
}
</script>

Horizontal Scrolling

This feature allows for horizontal scrolling of a large list of items. The `RecycleScroller` component is used with the `horizontal` prop to achieve this.


<template>
  <RecycleScroller
    :items="items"
    :item-size="100"
    key-field="id"
    horizontal
  >
    <template #default="{ item, index }">
      <div class="item">
        {{ item.name }}
      </div>
    </template>
  </RecycleScroller>
</template>

<script>
import { RecycleScroller } from 'vue-virtual-scroller'

export default {
  components: {
    RecycleScroller
  },
  data() {
    return {
      items: Array.from({ length: 1000 }).map((_, i) => ({ id: i, name: `Item ${i}` }))
    }
  }
}
</script>

Other packages similar to vue-virtual-scroller

Keywords

FAQs

Package last updated on 18 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc