
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
semantic-ui-range
Advanced tools
Add-on range slider for Semantic UI
I created the range slider for Semantic UI when I found that one currently did not exist.
The range slider is responsive and works for both mouse and touchscreen on all the devices it has been tested on. It uses standard css/javascript (no hacks) so it should render well on just about any remotely modern device. That said I have not thoroughly tested it, so let me know if you encounter any bugs.
##Usage
###Step 1
Add the range.js and range.css files from this repo to your project.
Alternatively, you can install using Bower:
bower install tyleryasaka/semantic-ui-range --save
###Step 2
Add the range slider html.
<div class="ui range" id="my-range"></div>
###Step 3
Instantiate the range slider with jQuery:
$(document).ready(function() {
$('#my-range').range({
min: 0,
max: 10,
start: 5
});
});
Notice the settings object you pass into the jQuery function in step 3. There are 6 settings you can pass in:
triggeredByUser
(boolean). true
unless the change was triggered programmatically using set value
. Useful for preventing infinite loops if you are calling a method that will call set value
.Use the onChange
callback in the configuration options. For example:
var myRangeValue; // your javascript variable that will store the value of the slider
$('#range').range({
min: 0,
max: 100,
start: 5,
onChange: function(val) { myRangeValue = val; } // assigning the callback argument to your variable each time the value changes
});
You may also set the slider value with jQuery using the 'setValue' query like so:
$('#range').range('set value', 17); // Sets slider with id 'range' to value 17
Note that this will only work on a slider that has already been instantiated.
If you're running code in your onChange
callback that calls the set value
method, you will encounter an infinite loop. You can prevent this by checking the triggeredByUser
property.
$('#range').range({
min: 0,
max: 100,
start: 5,
onChange: function(value, meta) {
if(meta.triggeredByUser) {
// now you can run code that will call `set value`
}
}
});
Check out the demo for examples.
I haven't had time to develop new features, but Buzut has added the ability to make the slider vertical:
FAQs
Add-on range slider for Semantic UI
The npm package semantic-ui-range receives a total of 12 weekly downloads. As such, semantic-ui-range popularity was classified as not popular.
We found that semantic-ui-range demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.