Gathering detailed insights and metrics for @deboxsoft/svelte-window
Gathering detailed insights and metrics for @deboxsoft/svelte-window
npm install @deboxsoft/svelte-window
Typescript
Module System
Node Version
NPM Version
74.4
Supply Chain
99
Quality
75.3
Maintenance
100
Vulnerability
100
License
Total Downloads
1,048
Last Day
1
Last Week
5
Last Month
17
Last Year
189
Minified
Minified + Gzipped
Latest Version
1.1.5
Package Id
@deboxsoft/svelte-window@1.1.5
Unpacked Size
105.76 kB
Size
19.21 kB
File Count
19
NPM Version
7.7.6
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-44.4%
5
Compared to previous week
Last month
21.4%
17
Compared to previous month
Last year
-11.7%
189
Compared to previous year
1
1
Svelte components for efficiently rendering large, scrollable lists and tabular data. Port of react-window to Svelte.
Svelte window works by only rendering part of a large data set (just enough to fill the viewport). This helps address some common performance bottlenecks:
1npm install --save-dev svelte-window
This library is a port of react-window, here are some examples: react-window.now.sh.
This is how to render a basic list:
1<script> 2 import { FixedSizeList as List, styleString as sty } from 'svelte-window'; 3</script> 4<List 5height={150} 6itemCount={1000} 7itemSize={35} 8width={300} 9let:items> 10 {#each items as it (it.key)} 11 <div style={sty(it.style)}>Row {it.index}</div> 12 {/each} 13</List>
Here is another example with a fixed size grid with a scroll-to button, scrolling indicators:
1<script> 2 import { FixedSizeGrid as Grid , styleString as sty} from 'svelte-window'; 3 4 let grid; 5 6 const click = () => { 7 if (grid){ 8 grid.scrollToItem({ 9 align: "start", 10 columnIndex: 150, 11 rowIndex: 300 12 }); 13 } 14 } 15 16</script> 17 18<Grid 19bind:this={grid} 20columnCount={1000} 21columnWidth={100} 22height={150} 23rowCount={1000} 24rowHeight={35} 25width={300} 26useIsScrolling 27let:items 28> 29 {#each items as it (it.key)} 30 <div style={sty(it.style)}> 31 { 32 isScrolling ? 33 'Scrolling' : 34 `Row ${rowIndex} - Col ${columnIndex}` 35 } 36 <div> 37 {/each} 38</Grid> 39<button on:click={click}> 40 To row 300, column 150 41</button>
styleString
is exported from svelte-window
, to convert the style object to stringinstance
. Eg. instead of1list.resetAfterIndex(...)
use
1list.instance.resetAfterIndex(...)
Affected functions:
VariableSizeList:
VariableSizeGrid:
svelte-virtualized-auto-sizer
: HOC that grows to fit all of the available space and passes the width and height values to its child.Here is a blog post about how the library was ported from React to Svelte.
No vulnerabilities found.
No security vulnerabilities found.