![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@doctormole/vue-virtual-scroll-grid
Advanced tools
This is a reusable component for Vue 3 that renders a list with a huge number of items (e.g. 1000+ items) as a grid in a performant way.
This is a reusable component for Vue 3 that renders a list with a huge number of items (e.g. 1000+ items) as a grid in a performant way.
npm install vue-virtual-scroll-grid
Name | Description | Type | Validation |
---|---|---|---|
length | The number of items in the list | number | Required, an integer greater than or equal to 0 |
pageProvider | The callback that returns a page of items as a promise. pageNumber start with 0 | (pageNumber: number, pageSize: number) => Promise<unknown[]> | Required |
pageSize | The number of items in a page from the item provider (e.g. a backend API) | number | Required, an integer greater than or equal to 1 |
pageProviderDebounceTime | Debounce window in milliseconds on the calls to pageProvider | number | Optional, an integer greater than or equal to 0, defaults to 0 |
probeTag | The HTML tag used as probe element. Default value is div | string | Optional, any valid HTML tag, defaults to div |
respectScrollToOnResize | Snap to the position set by scrollTo when the grid container is resized | boolean | Optional, defaults to false |
scrollBehavior | The behavior of scrollTo . Default value is smooth | smooth | auto | Optional, a string to be smooth or auto , defaults to smooth |
scrollTo | Scroll to a specific item by index | number | Optional, an integer from 0 to the length prop - 1, defaults to 0 |
tag | The HTML tag used as container element. Default value is div | string | Optional, any valid HTML tag, defaults to div |
getKey | The :key used on each grid item. Auto-generated, but overwritable via function | (internalItem: InternalItem) => number | string 1 | Optional, any valid Function that returns a string or number |
1
interface InternalItem {
index: number;
value: unknown | undefined;
style?: { transform: string; gridArea: string };
}
Example:
<Grid
:length="1000"
:pageProvider="async (pageNumber, pageSize) => Array(pageSize).fill('x')"
:pageSize="40"
:scrollTo="10"
>
<!-- ...slots -->
</Grid>
There are 3 scoped slots: default
, placeholder
and probe
.
default
slotThe default
slot is used to render a loaded item.
Props:
item
: the loaded item that is used for rendering your item
element/component.index
: the index of current item within the list.style
: the style object provided by the library that need to be set on the
item element/component.Example:
<template v-slot:default="{ item, style, index }">
<div :style="style">{{ item }} {{ index }}</div>
</template>
placeholder
slotWhen an item is not loaded, the component/element in the placeholder
slot will
be used for rendering. The placeholder
slot is optional. If missing, the space
of unloaded items will be blank until they are loaded.
Props:
index
: the index of current item within the list.style
: the style object provided by the library that need to be set on the
item element/component.Example:
<template v-slot:placeholder="{ index, style }">
<div :style="style">Placeholder {{ index }}</div>
</template>
probe
slotThe probe
slot is used to measure the visual size of grid item. It has no
prop. You can pass the same element/component for the
placeholder
slot. If not provided, you must set a fixed height
to grid-template-rows
on your CSS grid, e.g. 200px
. If provided, make sure
it is styled with the same dimensions as rendered items in the default
or placeholder
slot. Otherwise, the view wouldn't be rendered properly, or the
rendering could be very slow.
Example:
<template v-slot:probe>
<div class="item">Probe</div>
</template>
The library uses grid-auto-flow
CSS property to infer scroll mode. Set it to
column
value if you want to enable horizontal scroll.
The library does not require items have foreknown width and height, but do require them to be styled with the same width and height under a view. E.g. the items can be 200px x 200px when the view is under 768px and 300px x 500px above 768px.
Required environment variables:
VITE_APP_ID
: An Algolia app IDVITE_SEARCH_ONLY_API_KEY
: The search API key for the Algolia app abovenpm install
npm run dev
npm run lint
npm run build
npm run build -- --mode=demo
npm run serve
We use semantic-release to release the library on npm automatically.
FAQs
This is a reusable component for Vue 3 that renders a list with a huge number of items (e.g. 1000+ items) as a grid in a performant way.
The npm package @doctormole/vue-virtual-scroll-grid receives a total of 0 weekly downloads. As such, @doctormole/vue-virtual-scroll-grid popularity was classified as not popular.
We found that @doctormole/vue-virtual-scroll-grid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.