DocsThe iconThe value
The value
Every icon reads one CSS number, --v, from 0 to 1. What it means depends on the icon.
Pick an icon, then drag. The value means something different for each one.
#Rest value
Leave --v unset and an icon sits at its rest value: the state that looks most like itself. A battery rests full, a bell rests quiet. Each icon's page in the library says what its value sets.
#Set it
<svg class="fidg" style="--v: .62" viewBox="0 0 24 24">…</svg>/* half a star */
.rating .fidg:nth-child(4) { --v: .5; }icon.style.setProperty('--v', upload.loaded / upload.total);<Fidgicon icon={battery} value={level / 100} />#It glides
When the value changes, the icon glides to it in half a second. --fidg-glide sets the time: 0s to jump, 1.2s for a slow fill.
.meter .fidg { --fidg-glide: 1.2s; }#What the value means
| Icon | Value | At 0 | At 1 |
|---|---|---|---|
| Battery | charge | empty | full |
| Wifi | signal | no bars | full bars |
| Volume | level | muted | loud |
| Star | rating | empty | filled |
| Download | progress | waiting | done |
| Lock | locked | open | shut |
| Cup | how full | empty | full |
| Bell | unread | quiet | ringing |
Because the value is a CSS number, anything that sets CSS can drive it: a class, a :checked state, a media query, a scroll timeline or one line of script. The scroll guide ties it to the page with no script at all.
Something missing or unclear?Write to usRequest an icon