Socket
Socket
Sign inDemoInstall

chronocraft-scroller-vue

Package Overview
Dependencies
23
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chronocraft-scroller-vue

A Vue 3 Dynamic and Versatile High Performance Infinite Scroller Component


Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

A Vue 3 Dynamic and Versatile High Performance Infinite Scroller Component

The Chronocraft Scroller is a Vue 3 flexible scroller library infinite scroling support created for Vue3. It supports both vertical and horizontal orientations It provides smooth infinite scrolling with drag and mouse wheel navigation

Demo

Here is a working Demo of the component Demo: Chronocraft Scroller Demo{:target="_blank"}

Features

  • Vuejs 3.0 Based Code
  • Infinite Scroller
  • Horizontal and Vertical Support
  • Dynamic length of rows and columns
  • Mouse Wheel Support
  • Touch and Drag support

Usage of Scroller

Using the Library as a Plugin

import { ChronoCraftScroller } from 'chronocraft-scroller-vue';
    ...
app.use(ChronoCraftScroller)
Using seperate components of the library inside you project

When you want to import a specific component from the library into a dedicated place inside your code

import { Scroller } from 'chronocraft-scroller-vue';
...
components:{
Scroller
}
Example of Component
<Scroller orientation="horizontal" :cellwidth="200" :numcols="4" :numrows="4" :contentpadding="30" :wheelscrollspeed="20" :newcellslength="newcellslength" :data="scrollerdata" :cellsquared="true" @on-scroll="OnScroll" @on-update-data-next="onUpdateDataNext" @on-update-data-previous="onUpdateDataPrevious"/>
Example using Cell Slot
<Scroller orientation="horizontal" :cellwidth="200" :numcols="4" :numrows="4" :contentpadding="30" :wheelscrollspeed="20" :newcellslength="newcellslength" :data="scrollerdata" :cellsquared="true" @on-scroll="OnScroll" @on-update-data-next="onUpdateDataNext" @on-update-data-previous="onUpdateDataPrevious">
    <template v-slot:cell="slotProps">
        <span>{{ slotProps.data.id }}</span>
    </template>
</Scroller>

Component properties

NameTypeDescription
orientationStringDefines the orientation of the scroller. The possible values are horizontal or vertical
staticBooleanSet the Scroll view as static. No new data will be loaded wehn reaching at the end
cellwidthNumberDefines the base of the cellwidth on the vertical scroller
cellheightNumberDefines the base of the cellheight on the horizontal scroller
numcolsNumberThe total number of columns on the vertical scroller
numcolsNumberThe total number of columns on the horizontal scroller
contentpaddingNumberThe size of padding between the scroller cells
wheelscrollspeedNumberDefines the mouse wheel scroll speed
newcellslengthNumberThe total number of new cells that will be loaded when scrolling forward or backwards
v-modelArrayThe actual data passed into the scroller
cellsquaredBooleanSets the cell to be squared. (width will have the same size as the height)
hasscrollbarBooleanDefines if the scroller should have a scroll bar
@on-scrollEvent FunctionEvent fired when the user has scrolled
@on-update-data-nextEvent FunctionEvent fired when the user has reached at the end of the scroller and new data might be required to load
@on-update-data-previousEvent FunctionEvent fired when the user has reached at the start of the scroller and new data might be required to load
ScrollToCall FunctionFunction called to scroll the scroller to specific position in pixels
ScrollByCall FunctionFunction called to scroll the scroller by a specific amount in pixels
GetCellsPositionCall FunctionFunction called to get a specific cell's position in pixels

Component slots

NamehaspropsDescription
cellyesOverrides the cell rendering and passes the cells data as props
overlaynoIn this slot custom elements can be added as an overlay above the scroller content

Important Notice

To achive a smooth scrolling result without shaking or weird movement, the number of data cells loaded at initialization is relevant to the width of the scroller as well as the total new cell data added each time it receives new data.

Total Required Initial Data Length = ( Total visible cells ) + ( New cells added each time) * 3

This is calculated automatically and an alert screen appears when more data is required.

Keywords

FAQs

Last updated on 09 Jun 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc