UI / 091

Range input

連続値のスライダー
つまみを動かして、範囲内の値を選びます。

実際のHTML・CSSで描かれた見本です。

ラボで詳しく試す ↗

ひとつ試すなら

どこが変わるかを観察して、似た表現と見比べてみよう。

こんなときに

音量、強度、大きさなどの連続的な調整。

仕組みと使い方

キーボードの矢印キーでも値を変更できます。

スライダーrange調整つまみ
実装コードを見る
<style>
.sample{width:100%;height:100%;min-height:190px;display:grid;place-items:center;position:relative;overflow:hidden;box-sizing:border-box;font-family:Arial,'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;color:#20211d;background:#f1f0e9;padding:22px}.sample *{box-sizing:border-box}.sample button,.sample input,.sample summary{font:inherit}.sample button,.sample summary,.sample label{touch-action:manipulation}.sample :focus-visible{outline:3px solid #6050bf;outline-offset:5px}.sample small{font-size:10px;line-height:1.5}.sample .editable{margin:0}.sample svg{max-width:100%;height:auto}
.sample label{width:210px;font-size:13px;font-weight:700}.sample input{display:block;width:100%;margin:20px 0 7px;accent-color:#778e27}.sample span{display:flex;justify-content:space-between}
</style>
<div class="sample">
<label>強さを調整<input type="range" min="0" max="100" value="55" aria-label="サンプルの強さ"><span><small>0</small><small>100</small></span></label>
</div>