px-slider
Overview
Px-slider
is a Predix UI component used to define a value in a range or a range of values within set boundaries.
Usage
Prerequisites
- node.js
- npm
- bower
- webcomponents-lite.js polyfill
Node, npm, and bower are necessary to install the component and dependencies. webcomponents.js adds support for web components and custom elements to your application.
Getting Started
First, install the component via bower on the command line:
bower install px-slider --save
Second, import the component in your application with the following tag in your head:
<link rel="import" href="/bower_components/px-slider/px-slider.html"/>
Finally, use the component in your application:
Single handled slider
<px-slider
value="50"
min="1"
max="100">
</px-slider>
Multi-handled slider
<px-slider
start-value="20"
end-value="40"
min="1"
max="60">
</px-slider>
Single-handled slider with step
<px-slider
value="250"
step="50"
min="0"
max="500">
</px-slider>
Layout
The px-slider
will always take the full-width of whatever container it is in. If resized or made visible for the first time (if the slider was in a modal for example) then the slider will need to be notified through the iron-resizable-behavior, by - for example - manually calling notifyResize()
on it.
Documentation
Read the full API and view the demo here.
Local Development
From the component's directory...
$ npm install
$ bower install
$ gulp sass
From the component's directory, to start a local server run:
$ gulp serve
Navigate to the root of that server (e.g. http://localhost:8080/) in a browser to open the API documentation page, with link to the "Demo" / working examples.
GE Coding Style Guide
Known Issues
Please use Github Issues to submit any bugs you might find.