Tyre
import { useEffect, useRef, useState, type CSSProperties } from 'react';
const MIN = 10;
const MAX = 50;
const GOOD = [30, 36];
const GROUND = 128;
const R = 54;
const CX = 115;
// The tyre's outline at a pressure: round when hard; soft, it sinks onto the
// road, the bottom flattens into a contact patch and the sidewalls bulge.
function shape(psi: number) {
const v = Math.min(1, Math.max(0, (psi - MIN) / (MAX - MIN)));
const cy = GROUND - R * (0.7 + 0.3 * v ** 0.8);
const bulge = (1 - v) * 0.24;
const ring = (r: number, floor: number, k: number) =>
Array.from({ length: 72 }, (_, i) => {
const a = (i / 72) * 2 * Math.PI;
const s = Math.sin(a);
const x = CX + r * Math.cos(a) * (1 + k * bulge * Math.max(0, s) ** 3);
const y = Math.min(cy + r * s, floor);
return `${i ? 'L' : 'M'}${x.toFixed(1)} ${y.toFixed(1)}`;
}).join('') + 'Z';
return { cy, tyre: ring(R, GROUND, 1) + ring(R - 17, GROUND - 3, 0.6), tread: ring(R - 3, GROUND - 3, 1) };
}
const status = (psi: number) => (psi < 20 ? 'Flat' : psi < GOOD[0] ? 'Low' : psi <= GOOD[1] ? 'Good' : 'Firm');
const css = `
.slider-tyre { display: grid; gap: 10px; width: 230px; }
.slider-tyre__scene { display: block; width: 230px; height: 140px; overflow: visible; }
.slider-tyre__road { stroke: light-dark(#cbced3, #393c41); stroke-width: 2; stroke-linecap: round; }
.slider-tyre__shadow { fill: light-dark(#dbdde1, #121417); opacity: 0.8; filter: blur(3px); }
.slider-tyre__rubber { fill: light-dark(#50535b, #2e3035); fill-rule: evenodd; }
.slider-tyre__tread { fill: none; stroke: light-dark(#42454c, #232529); stroke-width: 4; stroke-dasharray: 4 3.2; }
.slider-tyre__rim { fill: light-dark(#6d7179, #7d8087); }
.slider-tyre__rim-edge { fill: none; stroke: light-dark(#5f626a, #a7abb2); stroke-width: 2.5; }
.slider-tyre__spoke { stroke: light-dark(#5f626a, #a7abb2); stroke-width: 5; stroke-linecap: round; }
.slider-tyre__hub { fill: light-dark(#50535b, #c6c8cd); }
.slider-tyre__valve { fill: light-dark(#50535b, #c6c8cd); }
.slider-tyre__read { display: flex; align-items: baseline; justify-content: space-between; }
.slider-tyre__psi { color: light-dark(#373a40, #f1f2f3); font-size: 26px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.slider-tyre__psi b { font-weight: inherit; }
.slider-tyre__psi small { margin-left: 3px; color: light-dark(#5f626a, #a7abb2); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; }
.slider-tyre__state { padding: 2px 8px; border-radius: 999px; background: light-dark(#ebedf0, #232529); color: light-dark(#50535b, #c6c8cd); font-size: 11px; font-weight: 600; }
.slider-tyre[data-good] .slider-tyre__state { background: light-dark(#373a40, #f1f2f3); color: light-dark(#f3f4f7, #1a1c1f); }
.slider-tyre__track { position: relative; height: 20px; margin-bottom: 10px; }
.slider-tyre__rail { position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: light-dark(#dbdde1, #2e3035); }
/* The recommended range is marked on the track. */
.slider-tyre__band { position: absolute; top: 8px; height: 4px; border-radius: 2px; left: calc(10px + ${(GOOD[0] - MIN) / (MAX - MIN)} * (100% - 20px)); width: calc(${(GOOD[1] - GOOD[0]) / (MAX - MIN)} * (100% - 20px)); background: light-dark(#5f626a, #a7abb2); }
.slider-tyre__band::before, .slider-tyre__band::after { content: ''; position: absolute; top: -4px; width: 1.5px; height: 12px; border-radius: 1px; background: light-dark(#5f626a, #a7abb2); }
.slider-tyre__band::before { left: 0; }
.slider-tyre__band::after { right: 0; }
.slider-tyre__band b { position: absolute; left: 50%; top: 13px; translate: -50% 0; color: light-dark(#6d7179, #7d8087); font-size: 9px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.slider-tyre__thumb { position: absolute; top: 0; left: calc(var(--slider-tyre-v) * (100% - 20px)); width: 20px; height: 20px; border-radius: 50%; background: light-dark(#373a40, #f1f2f3); box-shadow: 0 2px 6px light-dark(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.45)), inset 0 0 0 5px light-dark(#373a40, #f1f2f3), inset 0 0 0 7px light-dark(#6d7179, #7d8087); }
.slider-tyre:has(.slider-tyre__input:focus-visible) .slider-tyre__thumb { outline: 2px solid light-dark(#50535b, #c6c8cd); outline-offset: 3px; }
.slider-tyre__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: none; }
.slider-tyre__input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; }
.slider-tyre__input::-moz-range-thumb { width: 20px; height: 20px; border: 0; }
`;
export function Preview() {
const [psi, setPsi] = useState(22);
// The drawn pressure springs after the set one, so the tyre bounces as it fills.
const [shown, setShown] = useState(psi);
const motion = useRef({ x: psi, v: 0 });
useEffect(() => {
const still = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (still) {
motion.current = { x: psi, v: 0 };
setShown(psi);
return;
}
let raf = 0;
const step = () => {
const m = motion.current;
m.v = (m.v + (psi - m.x) * 0.14) * 0.72;
m.x += m.v;
if (Math.abs(psi - m.x) < 0.02 && Math.abs(m.v) < 0.02) m.x = psi;
else raf = requestAnimationFrame(step);
setShown(m.x);
};
raf = requestAnimationFrame(step);
return () => cancelAnimationFrame(raf);
}, [psi]);
const { cy, tyre, tread } = shape(shown);
const v = (psi - MIN) / (MAX - MIN);
const word = status(psi);
return (
<>
<style href="kit-sliders-tyre" precedence="kit">
{css}
</style>
<div className="slider-tyre" data-good={word === 'Good' ? '' : undefined} style={{ '--slider-tyre-v': v.toFixed(3) } as CSSProperties}>
<svg className="slider-tyre__scene" viewBox="0 0 230 140" aria-hidden="true">
<ellipse className="slider-tyre__shadow" cx={CX} cy={GROUND + 1} rx={R + 6} ry="4" />
<path className="slider-tyre__road" d={`M8 ${GROUND} H222`} />
<path className="slider-tyre__rubber" d={tyre} />
<path className="slider-tyre__tread" d={tread} />
<g className="slider-tyre__wheel" transform={`translate(${CX} ${cy.toFixed(1)})`}>
<circle className="slider-tyre__rim" r="37.5" />
{[0, 72, 144, 216, 288].map((a) => (
<path key={a} className="slider-tyre__spoke" d="M0 -9 V-28" transform={`rotate(${a})`} />
))}
<circle className="slider-tyre__rim-edge" r="36.5" />
<circle className="slider-tyre__hub" r="8" />
<rect className="slider-tyre__valve" x="22" y="-31" width="4" height="9" rx="1.5" transform="rotate(38)" />
</g>
</svg>
<div className="slider-tyre__read" aria-hidden="true">
<span className="slider-tyre__psi">
<b>{psi}</b>
<small>PSI</small>
</span>
<span className="slider-tyre__state">{word}</span>
</div>
<div className="slider-tyre__track">
<span className="slider-tyre__rail" aria-hidden="true" />
<span className="slider-tyre__band" aria-hidden="true">
<b>Recommended</b>
</span>
<span className="slider-tyre__thumb" aria-hidden="true" />
<input className="slider-tyre__input" type="range" min={MIN} max={MAX} value={psi} onChange={(e) => setPsi(+e.target.value)} aria-label="Tyre pressure" aria-valuetext={`${psi} psi, ${word.toLowerCase()}`} />
</div>
</div>
</>
);
}Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initSliderTyre(el) on the mounted element instead.
<div class="slider-tyre" style="--slider-tyre-v:0.300">
<svg class="slider-tyre__scene" viewBox="0 0 230 140" aria-hidden="true">
<ellipse class="slider-tyre__shadow" cx="115" cy="129" rx="60" ry="4"></ellipse>
<path class="slider-tyre__road" d="M8 128 H222"></path>
<path class="slider-tyre__rubber" d="M169.0 84.0L168.8 88.7L168.2 93.4L167.3 98.0L166.1 102.5L164.6 106.8L162.7 111.0L160.6 115.0L158.2 118.7L155.5 122.2L152.3 125.4L148.8 128.0L144.9 128.0L140.7 128.0L136.0 128.0L131.1 128.0L125.9 128.0L120.5 128.0L115.0 128.0L109.5 128.0L104.1 128.0L98.9 128.0L94.0 128.0L89.3 128.0L85.1 128.0L81.2 128.0L77.7 125.4L74.5 122.2L71.8 118.7L69.4 115.0L67.3 111.0L65.4 106.8L63.9 102.5L62.7 98.0L61.8 93.4L61.2 88.7L61.0 84.0L61.2 79.3L61.8 74.6L62.8 70.0L64.3 65.5L66.1 61.2L68.2 57.0L70.8 53.0L73.6 49.3L76.8 45.8L80.3 42.7L84.0 39.8L88.0 37.3L92.2 35.1L96.5 33.3L101.0 31.9L105.6 30.8L110.3 30.2L115.0 30.0L119.7 30.2L124.4 30.8L129.0 31.9L133.5 33.3L137.8 35.1L142.0 37.3L146.0 39.8L149.7 42.7L153.2 45.8L156.4 49.3L159.2 53.0L161.8 57.0L163.9 61.2L165.7 65.5L167.2 70.0L168.2 74.6L168.8 79.3ZM152.0 84.0L151.9 87.2L151.5 90.4L150.8 93.6L149.9 96.7L148.8 99.7L147.4 102.5L145.9 105.2L144.1 107.8L142.1 110.2L139.9 112.4L137.4 114.3L134.7 116.1L131.8 117.6L128.7 118.8L125.4 119.8L122.0 120.5L118.5 120.9L115.0 121.0L111.5 120.9L108.0 120.5L104.6 119.8L101.3 118.8L98.2 117.6L95.3 116.1L92.6 114.3L90.1 112.4L87.9 110.2L85.9 107.8L84.1 105.2L82.6 102.5L81.2 99.7L80.1 96.7L79.2 93.6L78.5 90.4L78.1 87.2L78.0 84.0L78.1 80.8L78.6 77.6L79.3 74.4L80.2 71.4L81.5 68.4L83.0 65.5L84.7 62.8L86.7 60.2L88.8 57.9L91.2 55.7L93.8 53.7L96.5 52.0L99.4 50.5L102.3 49.2L105.4 48.3L108.6 47.6L111.8 47.2L115.0 47.0L118.2 47.2L121.4 47.6L124.6 48.3L127.7 49.2L130.6 50.5L133.5 52.0L136.2 53.7L138.8 55.7L141.2 57.9L143.3 60.2L145.3 62.8L147.0 65.5L148.5 68.4L149.8 71.4L150.7 74.4L151.4 77.6L151.9 80.8Z"></path>
<path class="slider-tyre__tread" d="M166.0 84.0L165.8 88.5L165.3 92.9L164.4 97.2L163.2 101.5L161.8 105.6L160.1 109.5L158.1 113.3L155.8 116.8L153.2 120.1L150.3 123.1L147.0 125.0L143.3 125.0L139.2 125.0L134.9 125.0L130.2 125.0L125.3 125.0L120.2 125.0L115.0 125.0L109.8 125.0L104.7 125.0L99.8 125.0L95.1 125.0L90.8 125.0L86.7 125.0L83.0 125.0L79.7 123.1L76.8 120.1L74.2 116.8L71.9 113.3L69.9 109.5L68.2 105.6L66.8 101.5L65.6 97.2L64.7 92.9L64.2 88.5L64.0 84.0L64.2 79.6L64.8 75.2L65.7 70.8L67.1 66.6L68.8 62.5L70.8 58.5L73.2 54.8L75.9 51.2L78.9 48.0L82.2 44.9L85.7 42.2L89.5 39.8L93.4 37.8L97.6 36.1L101.8 34.8L106.1 33.8L110.6 33.2L115.0 33.0L119.4 33.2L123.9 33.8L128.2 34.8L132.4 36.1L136.6 37.8L140.5 39.8L144.3 42.2L147.8 44.9L151.1 48.0L154.1 51.2L156.8 54.8L159.2 58.5L161.2 62.5L162.9 66.6L164.3 70.8L165.2 75.2L165.8 79.6Z"></path>
<g class="slider-tyre__wheel" transform="translate(115 84.0)">
<circle class="slider-tyre__rim" r="37.5"></circle>
<path class="slider-tyre__spoke" d="M0 -9 V-28" transform="rotate(0)"></path>
<path class="slider-tyre__spoke" d="M0 -9 V-28" transform="rotate(72)"></path>
<path class="slider-tyre__spoke" d="M0 -9 V-28" transform="rotate(144)"></path>
<path class="slider-tyre__spoke" d="M0 -9 V-28" transform="rotate(216)"></path>
<path class="slider-tyre__spoke" d="M0 -9 V-28" transform="rotate(288)"></path>
<circle class="slider-tyre__rim-edge" r="36.5"></circle>
<circle class="slider-tyre__hub" r="8"></circle>
<rect class="slider-tyre__valve" x="22" y="-31" width="4" height="9" rx="1.5" transform="rotate(38)"></rect>
</g>
</svg>
<div class="slider-tyre__read" aria-hidden="true">
<span class="slider-tyre__psi">
<b>22</b>
<small>PSI</small>
</span>
<span class="slider-tyre__state">Low</span>
</div>
<div class="slider-tyre__track">
<span class="slider-tyre__rail" aria-hidden="true"></span>
<span class="slider-tyre__band" aria-hidden="true">
<b>Recommended</b>
</span>
<span class="slider-tyre__thumb" aria-hidden="true"></span>
<input class="slider-tyre__input" type="range" min="10" max="50" aria-label="Tyre pressure" aria-valuetext="22 psi, low" value="22"/>
</div>
</div>.slider-tyre { display: grid; gap: 10px; width: 230px; }
.slider-tyre__scene { display: block; width: 230px; height: 140px; overflow: visible; }
.slider-tyre__road { stroke: light-dark(#cbced3, #393c41); stroke-width: 2; stroke-linecap: round; }
.slider-tyre__shadow { fill: light-dark(#dbdde1, #121417); opacity: 0.8; filter: blur(3px); }
.slider-tyre__rubber { fill: light-dark(#50535b, #2e3035); fill-rule: evenodd; }
.slider-tyre__tread { fill: none; stroke: light-dark(#42454c, #232529); stroke-width: 4; stroke-dasharray: 4 3.2; }
.slider-tyre__rim { fill: light-dark(#6d7179, #7d8087); }
.slider-tyre__rim-edge { fill: none; stroke: light-dark(#5f626a, #a7abb2); stroke-width: 2.5; }
.slider-tyre__spoke { stroke: light-dark(#5f626a, #a7abb2); stroke-width: 5; stroke-linecap: round; }
.slider-tyre__hub { fill: light-dark(#50535b, #c6c8cd); }
.slider-tyre__valve { fill: light-dark(#50535b, #c6c8cd); }
.slider-tyre__read { display: flex; align-items: baseline; justify-content: space-between; }
.slider-tyre__psi { color: light-dark(#373a40, #f1f2f3); font-size: 26px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.slider-tyre__psi b { font-weight: inherit; }
.slider-tyre__psi small { margin-left: 3px; color: light-dark(#5f626a, #a7abb2); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; }
.slider-tyre__state { padding: 2px 8px; border-radius: 999px; background: light-dark(#ebedf0, #232529); color: light-dark(#50535b, #c6c8cd); font-size: 11px; font-weight: 600; }
.slider-tyre[data-good] .slider-tyre__state { background: light-dark(#373a40, #f1f2f3); color: light-dark(#f3f4f7, #1a1c1f); }
.slider-tyre__track { position: relative; height: 20px; margin-bottom: 10px; }
.slider-tyre__rail { position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: light-dark(#dbdde1, #2e3035); }
/* The recommended range is marked on the track. */
.slider-tyre__band { position: absolute; top: 8px; height: 4px; border-radius: 2px; left: calc(10px + 0.5 * (100% - 20px)); width: calc(0.15 * (100% - 20px)); background: light-dark(#5f626a, #a7abb2); }
.slider-tyre__band::before, .slider-tyre__band::after { content: ''; position: absolute; top: -4px; width: 1.5px; height: 12px; border-radius: 1px; background: light-dark(#5f626a, #a7abb2); }
.slider-tyre__band::before { left: 0; }
.slider-tyre__band::after { right: 0; }
.slider-tyre__band b { position: absolute; left: 50%; top: 13px; translate: -50% 0; color: light-dark(#6d7179, #7d8087); font-size: 9px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.slider-tyre__thumb { position: absolute; top: 0; left: calc(var(--slider-tyre-v) * (100% - 20px)); width: 20px; height: 20px; border-radius: 50%; background: light-dark(#373a40, #f1f2f3); box-shadow: 0 2px 6px light-dark(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.45)), inset 0 0 0 5px light-dark(#373a40, #f1f2f3), inset 0 0 0 7px light-dark(#6d7179, #7d8087); }
.slider-tyre:has(.slider-tyre__input:focus-visible) .slider-tyre__thumb { outline: 2px solid light-dark(#50535b, #c6c8cd); outline-offset: 3px; }
.slider-tyre__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: none; }
.slider-tyre__input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; }
.slider-tyre__input::-moz-range-thumb { width: 20px; height: 20px; border: 0; }function initSliderTyre(root) {
var input = root.querySelector('.slider-tyre__input');
var rubber = root.querySelector('.slider-tyre__rubber');
var tread = root.querySelector('.slider-tyre__tread');
var wheel = root.querySelector('.slider-tyre__wheel');
var number = root.querySelector('.slider-tyre__psi b');
var state = root.querySelector('.slider-tyre__state');
var min = +input.min;
var max = +input.max;
var ground = 128;
var radius = 54;
var cx = 115;
var still = window.matchMedia('(prefers-reduced-motion: reduce)');
var shown = +input.value;
var speed = 0;
var raf = 0;
// The outline at a pressure: round when hard; soft, it sinks onto the road,
// the bottom flattens into a contact patch and the sidewalls bulge.
function draw(psi) {
var v = Math.min(1, Math.max(0, (psi - min) / (max - min)));
var cy = ground - radius * (0.7 + 0.3 * Math.pow(v, 0.8));
var bulge = (1 - v) * 0.24;
function ring(r, floor, k) {
var d = '';
for (var i = 0; i < 72; i++) {
var a = (i / 72) * 2 * Math.PI;
var s = Math.sin(a);
var x = cx + r * Math.cos(a) * (1 + k * bulge * Math.pow(Math.max(0, s), 3));
var y = Math.min(cy + r * s, floor);
d += (i ? 'L' : 'M') + x.toFixed(1) + ' ' + y.toFixed(1);
}
return d + 'Z';
}
rubber.setAttribute('d', ring(radius, ground, 1) + ring(radius - 17, ground - 3, 0.6));
tread.setAttribute('d', ring(radius - 3, ground - 3, 1));
wheel.setAttribute('transform', 'translate(' + cx + ' ' + cy.toFixed(1) + ')');
}
function status(psi) { return psi < 20 ? 'Flat' : psi < 30 ? 'Low' : psi <= 36 ? 'Good' : 'Firm'; }
// The drawn pressure springs after the set one, so the tyre bounces as it fills.
function step() {
var target = +input.value;
speed = (speed + (target - shown) * 0.14) * 0.72;
shown += speed;
if (Math.abs(target - shown) < 0.02 && Math.abs(speed) < 0.02) {
shown = target;
raf = 0;
} else {
raf = requestAnimationFrame(step);
}
draw(shown);
}
function update() {
var psi = +input.value;
var word = status(psi);
root.style.setProperty('--slider-tyre-v', ((psi - min) / (max - min)).toFixed(3));
root.toggleAttribute('data-good', word === 'Good');
number.textContent = psi;
state.textContent = word;
input.setAttribute('aria-valuetext', psi + ' psi, ' + word.toLowerCase());
if (still.matches) {
shown = psi;
draw(psi);
} else if (!raf) {
raf = requestAnimationFrame(step);
}
}
input.addEventListener('input', update);
update();
return function () {
cancelAnimationFrame(raf);
input.removeEventListener('input', update);
};
}
document.querySelectorAll('.slider-tyre').forEach(initSliderTyre);Goal: Create a "Tyre" slider.
Visual behavior: Tyre pressure: at low psi the tyre sags flat on the road and bulges, and pumping it up rounds it out with a little bounce.
Technique:
- One real <input type="range"> lies transparent over the track (its thumb sized to the drawn handle, so the pointer lines up), and everything drawn is set from its value. The drawn pressure follows the set one on a small spring, so the tyre bounces as it fills.
- The tyre outline is drawn from 72 points round a circle: soft, the wheel sinks, the points below the road are flattened onto it, and the lower sidewalls are pushed outward.
- The tread is a dashed stroke on the same shape, so it follows the deformation.
- The recommended range is marked on the track, and the reading switches between Flat, Low, Good and Firm.
Accessibility: A native range input named "Tyre pressure" with an aria-valuetext in words, so a screen reader announces the reading rather than a bare number; keyboard focus outlines the drawn handle. The drawing is aria-hidden. Under prefers-reduced-motion the tyre changes shape without bouncing.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: neutral only. Black, white and grays, no hues. Use the color values above as written, or my project's closest neutral tokens.
Return a single self-contained component. No dependencies.Goal: Create a "Tyre" slider.
Visual behavior: Tyre pressure: at low psi the tyre sags flat on the road and bulges, and pumping it up rounds it out with a little bounce.
Technique:
- One real <input type="range"> lies transparent over the track (its thumb sized to the drawn handle, so the pointer lines up), and everything drawn is set from its value. The drawn pressure follows the set one on a small spring, so the tyre bounces as it fills.
- The tyre outline is drawn from 72 points round a circle: soft, the wheel sinks, the points below the road are flattened onto it, and the lower sidewalls are pushed outward.
- The tread is a dashed stroke on the same shape, so it follows the deformation.
- The recommended range is marked on the track, and the reading switches between Flat, Low, Good and Firm.
Accessibility: A native range input named "Tyre pressure" with an aria-valuetext in words, so a screen reader announces the reading rather than a bare number; keyboard focus outlines the drawn handle. The drawing is aria-hidden. Under prefers-reduced-motion the tyre changes shape without bouncing.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: use my project's existing color tokens. The color values above are grayscale placeholders. Map each one by its role (surface, text, border, accent, glow) to my theme, and keep their relative lightness so contrast and the effect still read.
Return a single self-contained component. No dependencies.Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Free to use in any project, commercial included. MIT-0, no attribution required. Licence
About this component
Tyre pressure: at low psi the tyre sags flat on the road and bulges, and pumping it up rounds it out with a little bounce.
- Dependencies
- None
- Difficulty
- Advanced
- Triggers
- state change, spring, morph
- Techniques
- svg, raf, spring
- Reduced motion
- Respected
- Theme
- Light and dark (follows your page's color-scheme)
A native range input named "Tyre pressure" with an aria-valuetext in words, so a screen reader announces the reading rather than a bare number; keyboard focus outlines the drawn handle. The drawing is aria-hidden. Under prefers-reduced-motion the tyre changes shape without bouncing.