1.0.4 • Published 2 years ago

react-list-shuffle v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

react-list-shuffle

Lightweight, easy to use component for animated shuffling and change order in lists

React list shuffle.webm

Demo

Live Demo

Installation

# with npm
npm install react-list-shuffle
# with yarn
yarn add react-list-shuffle

Basic usage

import ListShuffle from 'react-list-shuffle';

const anyListItemsArray = [0, 1, 2, 3, 4, 5];
  <ListShuffle shuffle={ shuffleKey } duration={ 2 } restoreOrder={ restoreOrderKey }>
    { anyListItemsArray.map((item: number) => <div key={ item }>
      ITEM { item }
    </div>)}
  </ListShuffle>

Props

NAMETYPEDEFAULTDESCRIPTION
idStringlistWrapperComponent id
durationNumber1Animation duration (sec)
shuffleString, Number, BooleanDate.now()Change this prop for calling shuffling
shuffleOnInitBooleanfalseIf true, shuffles list on first init
restoreOrderString, Number, BooleanDate.now()Change this prop for restoring initial list order
shuffledHandler(args: number[]) => anyundefinedOptionally callback firing after shuffling animation. Receives array with list items indexes on new positions.
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago