24 / 28
All 28 in 28 Tailwind CSS Input Fields
- 01Tailwind Floating Label Input
- 02Tailwind Underline Sweep Input
- 03Tailwind Neon Glow Input
- 04Tailwind Frosted Glass Input
- 05Tailwind Notched Outline Input
- 06Tailwind Drawn Border Input
- 07Tailwind Inline Validation Input
- 08Tailwind Search Input With Clear
- 09Tailwind Password Strength Meter
- 10Tailwind OTP Code Input
- 11Tailwind Rotating Placeholder Input
- 12Tailwind Tag Chip Input
- 13Tailwind Phone Input With Country
- 14Tailwind Stepper Number Input
- 15Tailwind File Drop Zone
- 16Tailwind Currency Input
- 17Tailwind Native Date Input
- 18Tailwind Time Range Input
- 19Tailwind Colour Picker Input
- 20Tailwind Voice Search Input
- 21Tailwind Email Suggestion Combobox
- 22Tailwind Auto-Grow Textarea
- 23Tailwind Inline Edit Field
- 24Tailwind Range Slider
- 25Tailwind URL Input With Protocol
- 26Tailwind Credit Card Input
- 27Tailwind Password Toggle Input
- 28Tailwind Brutalist Input
Tailwind Range Slider
A native type="range" with a painted fill and a live value chip. The script writes one custom property; the gradient and the chip both read it — so dragging touches a single number, not a stylesheet.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<div class="tif-24 grid min-h-svh w-full place-items-center bg-tif24-bg px-6 py-14 font-tif24-mono" aria-label="Range slider demo">
<div class="grid w-full max-w-70 gap-2">
<label for="tif24-input" class="flex items-center justify-between text-[10px] tracking-[0.12em] text-tif24-mut uppercase">
Volume
<output for="tif24-input" data-tif24-out class="rounded-full bg-tif24-acc px-1.75 py-0.75 text-[11px] font-bold tracking-normal text-tif24-ink">50</output>
</label>
<input id="tif24-input" type="range" name="tif24-volume" min="0" max="100" value="50" data-tif24
class="h-1.5 w-full cursor-pointer appearance-none rounded-full bg-[linear-gradient(90deg,var(--color-tif24-acc)_0%,var(--color-tif24-acc)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_100%)] outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tif24-acc [&::-moz-range-thumb]:size-4.5 [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-white [&::-webkit-slider-thumb]:size-4.5 [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-[0_2px_6px_oklch(0.62_0.2_288/0.5)] [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:duration-150 [&::-webkit-slider-thumb:hover]:scale-112">
</div>
</div><div class="tif-24 grid min-h-svh w-full place-items-center bg-tif24-bg px-6 py-14 font-tif24-mono" aria-label="Range slider demo">
<div class="grid w-full max-w-70 gap-2">
<label for="tif24-input" class="flex items-center justify-between text-[10px] tracking-[0.12em] text-tif24-mut uppercase">
Volume
<output for="tif24-input" data-tif24-out class="rounded-full bg-tif24-acc px-1.75 py-0.75 text-[11px] font-bold tracking-normal text-tif24-ink">50</output>
</label>
<input id="tif24-input" type="range" name="tif24-volume" min="0" max="100" value="50" data-tif24
class="h-1.5 w-full cursor-pointer appearance-none rounded-full bg-[linear-gradient(90deg,var(--color-tif24-acc)_0%,var(--color-tif24-acc)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_100%)] outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tif24-acc [&::-moz-range-thumb]:size-4.5 [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-white [&::-webkit-slider-thumb]:size-4.5 [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-[0_2px_6px_oklch(0.62_0.2_288/0.5)] [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:duration-150 [&::-webkit-slider-thumb:hover]:scale-112">
</div>
</div>@import "tailwindcss";
@theme {
--color-tif24-bg: #12121a;
--color-tif24-bg: oklch(0.19 0.015 285);
--color-tif24-ink: #f0eeff;
--color-tif24-ink: oklch(0.95 0.02 290);
--color-tif24-mut: #b8b6d4;
--color-tif24-mut: oklch(0.77 0.03 290);
--color-tif24-acc: #7c6cff;
--color-tif24-acc: oklch(0.62 0.2 288);
--font-tif24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-24 {
width: 100%;
}
.tif-24 ::selection {
background: var(--color-tif24-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif24-bg: #12121a;
--color-tif24-bg: oklch(0.19 0.015 285);
--color-tif24-ink: #f0eeff;
--color-tif24-ink: oklch(0.95 0.02 290);
--color-tif24-mut: #b8b6d4;
--color-tif24-mut: oklch(0.77 0.03 290);
--color-tif24-acc: #7c6cff;
--color-tif24-acc: oklch(0.62 0.2 288);
--font-tif24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-24 {
width: 100%;
}
.tif-24 ::selection {
background: var(--color-tif24-acc);
color: #12121a;
}(function () {
document.querySelectorAll('.tif-24').forEach(function (root) {
if (root.dataset.bound) return; root.dataset.bound = '1';
root.querySelectorAll('[data-tif24]').forEach(function (input) {
var out = root.querySelector('[data-tif24-out]');
function update() {
var min = Number(input.min) || 0;
var max = Number(input.max) || 100;
var pct = ((Number(input.value) - min) / (max - min)) * 100;
input.style.setProperty('--tif24-fill', pct + '%');
if (out) out.value = input.value;
}
input.addEventListener('input', update);
update();
});
});
})();(function () {
document.querySelectorAll('.tif-24').forEach(function (root) {
if (root.dataset.bound) return; root.dataset.bound = '1';
root.querySelectorAll('[data-tif24]').forEach(function (input) {
var out = root.querySelector('[data-tif24-out]');
function update() {
var min = Number(input.min) || 0;
var max = Number(input.max) || 100;
var pct = ((Number(input.value) - min) / (max - min)) * 100;
input.style.setProperty('--tif24-fill', pct + '%');
if (out) out.value = input.value;
}
input.addEventListener('input', update);
update();
});
});
})();Setup — do this once per project
Skip this if your project already runs Tailwind v4.
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>Compiles in the browser — perfect for a CodePen or a quick test, not for production.
npm install tailwindcss @tailwindcss/vite
npm install tailwindcss @tailwindcss/vite// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})// vite.config.js ("type": "module" in package.json)
import { defineConfig } from 'vite'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [tailwindcss()],
})Any v4 setup works — Vite, PostCSS or the CLI. Nothing in this demo is bundler-specific.
@import "tailwindcss";
@theme {
--color-tif24-bg: #12121a;
--color-tif24-bg: oklch(0.19 0.015 285);
--color-tif24-ink: #f0eeff;
--color-tif24-ink: oklch(0.95 0.02 290);
--color-tif24-mut: #b8b6d4;
--color-tif24-mut: oklch(0.77 0.03 290);
--color-tif24-acc: #7c6cff;
--color-tif24-acc: oklch(0.62 0.2 288);
--font-tif24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-24 {
width: 100%;
}
.tif-24 ::selection {
background: var(--color-tif24-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif24-bg: #12121a;
--color-tif24-bg: oklch(0.19 0.015 285);
--color-tif24-ink: #f0eeff;
--color-tif24-ink: oklch(0.95 0.02 290);
--color-tif24-mut: #b8b6d4;
--color-tif24-mut: oklch(0.77 0.03 290);
--color-tif24-acc: #7c6cff;
--color-tif24-acc: oklch(0.62 0.2 288);
--font-tif24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-24 {
width: 100%;
}
.tif-24 ::selection {
background: var(--color-tif24-acc);
color: #12121a;
}<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- The value chip became an
<output for>— the element that exists for exactly this, and which the original rendered as a span. - A
focus-visible:outlinewas added: the original setoutline: noneon a keyboard-operable control with nothing in its place. - Both thumb pseudos are bracket variants sitting in the same class list, which is the first time the WebKit/Firefox split is visible at the element rather than fifty lines apart.
Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Range Slider
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-range-slider/
A native type="range" with a painted fill and a live value chip. The script writes one custom property; the gradient and the chip both read it — so dragging touches a single number, not a stylesheet.
## HTML
```html
<div class="tif-24 grid min-h-svh w-full place-items-center bg-tif24-bg px-6 py-14 font-tif24-mono" aria-label="Range slider demo">
<div class="grid w-full max-w-70 gap-2">
<label for="tif24-input" class="flex items-center justify-between text-[10px] tracking-[0.12em] text-tif24-mut uppercase">
Volume
<output for="tif24-input" data-tif24-out class="rounded-full bg-tif24-acc px-1.75 py-0.75 text-[11px] font-bold tracking-normal text-tif24-ink">50</output>
</label>
<input id="tif24-input" type="range" name="tif24-volume" min="0" max="100" value="50" data-tif24
class="h-1.5 w-full cursor-pointer appearance-none rounded-full bg-[linear-gradient(90deg,var(--color-tif24-acc)_0%,var(--color-tif24-acc)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_100%)] outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tif24-acc [&::-moz-range-thumb]:size-4.5 [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-white [&::-webkit-slider-thumb]:size-4.5 [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-[0_2px_6px_oklch(0.62_0.2_288/0.5)] [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:duration-150 [&::-webkit-slider-thumb:hover]:scale-112">
</div>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif24-bg: #12121a;
--color-tif24-bg: oklch(0.19 0.015 285);
--color-tif24-ink: #f0eeff;
--color-tif24-ink: oklch(0.95 0.02 290);
--color-tif24-mut: #b8b6d4;
--color-tif24-mut: oklch(0.77 0.03 290);
--color-tif24-acc: #7c6cff;
--color-tif24-acc: oklch(0.62 0.2 288);
--font-tif24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-24 {
width: 100%;
}
.tif-24 ::selection {
background: var(--color-tif24-acc);
color: #12121a;
}
```
## JavaScript
```js
(function () {
document.querySelectorAll('.tif-24').forEach(function (root) {
if (root.dataset.bound) return; root.dataset.bound = '1';
root.querySelectorAll('[data-tif24]').forEach(function (input) {
var out = root.querySelector('[data-tif24-out]');
function update() {
var min = Number(input.min) || 0;
var max = Number(input.max) || 100;
var pct = ((Number(input.value) - min) / (max - min)) * 100;
input.style.setProperty('--tif24-fill', pct + '%');
if (out) out.value = input.value;
}
input.addEventListener('input', update);
update();
});
});
})();
```Here's a working CSS demo from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Tailwind Range Slider
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-range-slider/
A native type="range" with a painted fill and a live value chip. The script writes one custom property; the gradient and the chip both read it — so dragging touches a single number, not a stylesheet.
## HTML
```html
<div class="tif-24 grid min-h-svh w-full place-items-center bg-tif24-bg px-6 py-14 font-tif24-mono" aria-label="Range slider demo">
<div class="grid w-full max-w-70 gap-2">
<label for="tif24-input" class="flex items-center justify-between text-[10px] tracking-[0.12em] text-tif24-mut uppercase">
Volume
<output for="tif24-input" data-tif24-out class="rounded-full bg-tif24-acc px-1.75 py-0.75 text-[11px] font-bold tracking-normal text-tif24-ink">50</output>
</label>
<input id="tif24-input" type="range" name="tif24-volume" min="0" max="100" value="50" data-tif24
class="h-1.5 w-full cursor-pointer appearance-none rounded-full bg-[linear-gradient(90deg,var(--color-tif24-acc)_0%,var(--color-tif24-acc)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_var(--tif24-fill,50%),oklch(1_0_0/0.08)_100%)] outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-tif24-acc [&::-moz-range-thumb]:size-4.5 [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:bg-white [&::-webkit-slider-thumb]:size-4.5 [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-0 [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-[0_2px_6px_oklch(0.62_0.2_288/0.5)] [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:duration-150 [&::-webkit-slider-thumb:hover]:scale-112">
</div>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif24-bg: #12121a;
--color-tif24-bg: oklch(0.19 0.015 285);
--color-tif24-ink: #f0eeff;
--color-tif24-ink: oklch(0.95 0.02 290);
--color-tif24-mut: #b8b6d4;
--color-tif24-mut: oklch(0.77 0.03 290);
--color-tif24-acc: #7c6cff;
--color-tif24-acc: oklch(0.62 0.2 288);
--font-tif24-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-24 {
width: 100%;
}
.tif-24 ::selection {
background: var(--color-tif24-acc);
color: #12121a;
}
```
## JavaScript
```js
(function () {
document.querySelectorAll('.tif-24').forEach(function (root) {
if (root.dataset.bound) return; root.dataset.bound = '1';
root.querySelectorAll('[data-tif24]').forEach(function (input) {
var out = root.querySelector('[data-tif24-out]');
function update() {
var min = Number(input.min) || 0;
var max = Number(input.max) || 100;
var pct = ((Number(input.value) - min) / (max - min)) * 100;
input.style.setProperty('--tif24-fill', pct + '%');
if (out) out.value = input.value;
}
input.addEventListener('input', update);
update();
});
});
})();
```How this works
One property, two readers. On input the handler computes the percentage and writes it once:
input.style.setProperty('--tif24-fill', pct + '%');
output.value = input.value;The element stays native. Arrow keys, Page Up/Down, Home/End, screen-reader announcement of min, max and current value, and form serialisation all come free — which is the whole reason not to build a slider out of divs.
Make it yours
- Bounds:
min,max,stepon the element; no JS change. - One-liner theme: replace the gradient with
accent-tif24-accand lose custom thumb sizing. - Thumb:
[&::-webkit-slider-thumb]:size-4.5and its Firefox twin — change both or one browser drifts. - Dual-thumb: overlay two inputs,
pointer-events-noneon the track andautoon the thumbs.
Gotchas — read before shipping
- WebKit and Firefox thumb selectors cannot share a rule. An invalid selector in the list drops the whole thing — that is true in a bracket variant too.
accent-colorand custom thumb sizing are mutually exclusive. Pick one per project.- A value chip is decoration for screen readers — the range input already announces its value, so keep the chip
aria-hiddenor useoutputas here.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
The manual gradient pattern works everywhere; accent-color is Chrome 93+, Safari 15.4+, Firefox 92+.