Web Basics
Star Rating
Hover to preview, click to choose — a real interactive widget.
Five stars that light up as you hover and lock in when you click. You'll learn the difference between a temporary hover state and committed state, and how to keep it keyboard-friendly.
What's inside
- Hover preview vs. selected value
- Keyboard support with the arrow keys
- Each star is a real, labelled button
- Remembers your last rating
- Light & dark mode, no dependencies
Quickstart
$ curl -LO https://devai.io/downloads/star-rating.zip$ unzip star-rating.zip && cd star-rating$ open index.html # or just double-click the file
about this tutorial
A devai.io starter tutorial — building an interactive widget with two kinds of state.
More in Web Basics
view allWeb Basics
Tip Calculator
Your first interactive page: type a bill, see the tip update live.
HTMLCSSJavaScript
View template zip + preview
Web Basics
To-Do List
Keep a list, tick things off, and have it still be there after a refresh.
HTMLCSSJavaScriptlocalStorage
View template zip + preview
Web Basics
Countdown Timer
Count down to any moment — days, hours, minutes, seconds, ticking live.
HTMLCSSJavaScriptDates
View template zip + preview