1.0.0 • Published 3 years ago

react-disks v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-disks

A shared react component for a stack of rotatable disks containing text.

If an m×n array of text items is passed to the component, m disks will render with n items evenly spaced around each disk.

Installation

npm install react-disks

Please note that dependencies of this package require React 18.0.0 or later.

Example

import ReactDisks from 'react-disks';

function App() {
  return (
    <ReactDisks
      disksText={[['a', 'b', 'c', 'd'], ['e', 'f', 'g', 'h'], ['i', 'j', 'k', 'l']]}
      onRotate={(rotatedDisksText) => console.log(rotatedDisksText)}
      theme={{main: "magenta", light: "plum", dark: "darkmagenta"}}
      disabled={false}
      swipeMode={false}
      swipeContainer={".someContainer"}
      darkMode={false}
    />
  );
}

export default App;

Props

PropTypeRequiredDescription
disksText2D arrayyesText to be displayed in each disk
onRotatefunctionnoFunction called after a disk is rotated (use to obtain new order of text)
themeobjectnoComponent colouring (options: main, light, and dark)
disabledbooleannoWhether the disks should be disabled
swipeModebooleannoWhether the disks are rotated via swipe gestures
swipeContainerstringnoSelector for a container to restrict swipe gesture detection
darkModebooleannoWhether the component theming should be dark or light
1.7.3

1 year ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.1

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago