README
wmtp slider module
This module is a react slider component to be used in node.js applications
Setting up the module
- clone the repository
- run "npm install" to install dependencies needed to run
Building the module
The module uses Typescript compiler (TSC) to compile the source code. To build the project run the following command:
- npm run build
Installing the module for testing
You can install the module into your own node.js project as a dependency. After you clone the module you can install using the following command:
- npm install /absolute/path/to/modules/directory
- i.e. -> npm install /Users/jclark/Documents/WorkProjects/custom-node-modules/wmtp-slider
Installing the module from npm
Use the following command to install from npm
- npm install wmtp-slider
Importing the module
Once you have the module installed you can import exported functions into your code like so:
import WmtpSlider from 'wmtp-slider'
Using the module
Here is an example of the component being used
<WmtpSlider
lowerTag={"Relaxed"}
upperTag={"Anxious"}
title="Anxiety"
value={this.state.anxietySlider}
handleChange={this.handleAnxietyChange}
/>
- lowerTag: The text that will appear on the left of the slider
- upperTag: The text that will appear on the right of the slider
- title: This prop is optional. It will place a title above the slider
- value: The current state of the slider
- handleChange: A handler function that is called when the slider value changes
Viewing ReactDocs
You can view the React Docs by entering the following command:
- npm start
This will start a development server on localhost:6060 showing all the properties for the WMTP Slider module
Published module
Here is where the module is currently published: https://www.npmjs.com/package/wmtp-slider