Getting Started with ReactJS Slider
4 Jul 20221 minute to read
This section helps to get started of the Slider component in a React application
Create a Slider
Refer the common React Getting Started Documentation to create an application and add necessary scripts and styles for rendering our ReactJS components.
Create a JSX file and use <EJ.Slider> syntax to render React Slider component. Add required properties to <EJ.Slider> tag element.
ReactDOM.render(
<EJ.Slider>
</EJ.Slider>,
document.getElementById('default-slider')
);
Define an HTML element for adding Slider in the application and refer the JSX file created.
<div id="default-slider"></div>
<script type="text/babel" src="sample.jsx">
This will render an default Slider component on executing.
Configure Properties
In the JSX, need to declare the Slider properties. Refer to the following code,.
ReactDOM.render(
<EJ.Slider value={20} >
</EJ.Slider>,
document.getElementById('default-slider')
);
Run the above code to render the following output,
Note: You can find the Slider properties from the API reference document.