# Creating the perfect slider

DevFeed: [Creating the perfect slider](<https://devfeed.tech/articles/creating-the-perfect-slider-51950.md>)

Original publisher: [Read original article](<https://lea.verou.me/2009/04/creating-the-perfect-slider/>)

Author: Lea Verou

Published: 2009-04-24T00:00:00Z

Content type: article

Language: en

Sources: [Lea Verou's blog](<https://devfeed.tech/sources/lea-verou-s-blog.md>)

Topics: [Web Accessibility (a11y)](<https://devfeed.tech/topics/web-accessibility.md>), [Usability](<https://devfeed.tech/topics/usability.md>), [User interface design](<https://devfeed.tech/topics/ui-design.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [accessibility-guidelines](<https://devfeed.tech/tags/accessibility-guidelines.md>), [article](<https://devfeed.tech/tags/article.md>), [articles](<https://devfeed.tech/tags/articles.md>), [blog](<https://devfeed.tech/tags/blog.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [draggable](<https://devfeed.tech/tags/draggable.md>), [form](<https://devfeed.tech/tags/form.md>), [forms](<https://devfeed.tech/tags/forms.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [usability](<https://devfeed.tech/tags/usability.md>), [ux](<https://devfeed.tech/tags/ux.md>), [web](<https://devfeed.tech/tags/web.md>)

## AI overview

An article proposes usability and accessibility requirements for a slider control, especially one used in a color picker. It recommends ARIA compatibility, keyboard focus, labeling, draggable interaction, distinct visual states, and immediate movement when users click the slider rail.

## Source excerpt

I've previously discussed many times the color picker I have to create, and blogged about my findings on the way. An essential component of most color pickers is a slider control. I won't go through much techincal details or JavaScript code in this article (after all the usability guidelines presented don't only apply to JavaScript applications, and this is why I used Adobe Kuler as a good or bad example for some of them), it's been done numerous times before and I prefer being a bit original than duplicating web content. You can google it and various implementations will come up if you need a starting point. Some might argue that I suffer from NIH syndrome, but I prefer to code things my way when I think I can do something even a bit better. After all, if nobody ever tries to reinvent the wheel, the wheel stands no chances of improvement. In this case, I wanted to build the most usable slider ever (at least for color picking uses), or -from an arguably more conservative point of view- something significantly more usable than the rest (if you think about it, the two statements are equivalent, the first one just sounds more arrogant :P ). I started by thinking about the way I personally use sliders and other form controls, and what bothers me most in the process. Then I combined that with the previously-done accessibility guidelines and the best slider implementations I've encountered (from a usability perspective), and here is what I came up with. Requirements for the perfect slider control It should be ARIA-compatible, so that disabled users can easily utilize it. It should be focusable, so that you can Tab to it. Of course the thumb should be draggable (why would you call it a slider otherwise anyway?) Of course the slider should be labeled so that the user knows what to use it for. Normal, hover and focus states should be different (at least in browsers supporting the :hover and :focus pseudo-classes) You should be able to click somewhere in the rail and have the