5.3.0 • Published 3 years ago

@astrouxds/rux-slider v5.3.0

Weekly downloads
68
License
SEE LICENSE IN LI...
Repository
github
Last release
3 years ago

Slider

A Slider allows users to choose from a range of continuous and discrete values. The Slider displays the range of possible values and the Slider’s indicator displays the current value.

Guidelines

Web Components Usage

1. Installation

Install the Astro UXDS Slider package via Command Line (Preferred Method)

npm i -save @astrouxds/rux-slider

You may use Yarn, NPM, or your Node package manager of choice. The --save flag adds this component as a dependency in your package.json file.

Alternatively, download the Astro UXDS Component Library source to your project.

Via CLI:

git clone https://github.com/RocketCommunicationsInc/astro-components.git

Or, download the Astro UXDS Components as a .zip

2. Import the Astro Slider Web Component

This example assumes you're using the NPM package in node_modules. Otherwise, import the component using the path to the Astro Components directory in your project.

import { RuxSlider } from '@astrouxds/rux-slider/rux-slider.js'

3. Render the Astro Slider Web Component

Pass properties via attributes similar to the native HTML Input Range attributes:

<rux-slider
  min="0"
  max="400"
  step="5"
  val="200"
  label="Flow"
  axisLabels="['Low', 'Medium', 'High']"
  disabled
  hideInput
  >
</rux-slider>

Properties

PropertyTypeDefaultRequiredDescription
valNumber0YesWhen passed in, declares the default value for the slider on mount. Updates a reflected property val on the component whenever changed.
minNumber0NoOverrides the default value of 0. Can be a positive or negative number.
maxNumber100NoOverrides the default value of 100. Can be a positive or negative number.
stepNumber1NoCan be used to customize each step (e.g., count by 10) or to force an input to accept float values. Note: accepting float values in the input does not make existing code expecting integers understand float values.
axisLabelsArray[]NoAdds a row of labels below the range slider. Placement is approximate and should not be used for precise indicators. Labels will be force-justified across available horizontal space.
labelString''NoLabel for the slider element
hideInputBooleanfalseNoHides the input field from view
disabledBooleanfalseNoSets a disabled state on the component, which prevents typical user action from changing the value.

Revision History

5.0
  • Removed fallback CSS properties
4.0
  • clarified docs/code regarding value vs val property name
  • added flex styling to make Astro UXDS Slider inherit width of containing element.
  • renamed axis-labels property to axisLabels, and changed the type from comma-delimited String to Array.
  • documented hideInput property
  • Replaced Polymer 3 implementation with LitElement for improved speed and interoperability with JS Frameworks as well as simpler template declaration now available in vanilla JavaScript.
5.3.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.3

4 years ago

4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago