Rate Slider
A Slider component for displaying rate in range.
Importing
To use the rate slider component, first you need to register the component inside the page. You can register the component manually by importing the register function:
ts
import { register } from "@tapsioss/web-components/rate-slider";
register(); // Now the rate slider component is ready to use!
ts
import { registerRateSlider } from "@tapsioss/web-components";
registerRateSlider(); // Now the rate slider component is ready to use!
Also you can automatically register the component by importing it with the following approach:
ts
import "@tapsioss/web-components/rate-slider/element";
TIP
If you want to use all the component in your app, you can call registerAll
at the root of your project.
ts
import { registerAll } from "@tapsioss/web-components";
registerAll(); // All the components are now available
In the React package, you can easily add the component using the following code:
ts
import { RateSlider } from "@tapsioss/react-components";
Component Usage
html
<tapsi-rate-slider></tapsi-rate-slider>
tsx
<RateSlider />
Properties
Name | Attribute Name | Description | Type | Default Value |
---|---|---|---|---|
value | value | The current value of the input. It is always a string. | string | "" |
valueText | valuetext | Defines the human-readable text alternative of value. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext | string | "" |
label | label | Defines a string value that can be used to name input. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label | string | "" |
labelledBy | labelledby | Identifies the element (or elements) that labels the input. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby | string | "" |
max | max | Defines the maximum value in the range of permitted values. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max | string | DEFAULT_MAX |
min | min | Defines the minimum value in the range of permitted values. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min | string | DEFAULT_MIN |
autofocus | autofocus | Indicates that the element should be focused on page load. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus | boolean | false |
valueAsNumber | - | The input's value as a number. | number | - |
Methods
Name | Description | Parameters |
---|---|---|
stepDown | Decrements the value of the input. | |
stepUp | Increments the value of the input. |
Events
Name | Description | Type | Bubbles | Cancelable |
---|---|---|---|---|
change | Fired when value changes. | Event | ❌ | ❌ |