Skip to content

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

NameAttribute NameDescriptionTypeDefault Value
valuevalueThe current value of the input. It is always a string.string""
valueTextvaluetextDefines the human-readable text alternative of value.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-valuetext
string""
labellabelDefines a string value that can be used to name input.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
string""
labelledBylabelledbyIdentifies the element (or elements) that labels the input.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby
string""
maxmaxDefines the maximum value in the range of permitted values.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
stringDEFAULT_MAX
minminDefines the minimum value in the range of permitted values.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
stringDEFAULT_MIN
autofocusautofocusIndicates that the element should be focused on page load.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus
booleanfalse
valueAsNumber-The input's value as a number.number-

Methods

NameDescriptionParameters
stepDownDecrements the value of the input.
stepUpIncrements the value of the input.

Events

NameDescriptionTypeBubblesCancelable
changeFired when value changes.Event

Created with 🧡