16 / 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 Currency Input
Right-aligned money with an inline $ that lights up on focus. tabular-nums keeps digit widths locked as the user types — the detail that makes a column of amounts stop shimmering.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<div class="tif-16 grid min-h-svh w-full place-items-center bg-tif16-bg px-6 py-14 font-tif16-sans" aria-label="Currency input demo">
<label class="grid w-full max-w-70 gap-1.5">
<span class="font-tif16-mono text-[10px] tracking-[0.12em] text-tif16-mut uppercase">Amount</span>
<span class="group flex items-center gap-1.5 rounded-[10px] border border-white/12 bg-tif16-field px-3.5 transition-[border-color,background-color] duration-200 focus-within:border-tif16-acc focus-within:bg-tif16-field2">
<span class="text-sm font-semibold text-tif16-mut transition-colors duration-200 group-focus-within:text-tif16-acc" aria-hidden="true">$</span>
<input type="text" name="tif16-amount" inputmode="decimal" pattern="[0-9.,]*" placeholder="0.00"
class="min-w-0 flex-1 border-0 bg-transparent py-3 text-right text-sm font-semibold tabular-nums text-tif16-ink outline-none placeholder:text-tif16-mut">
<span class="font-tif16-mono text-[10px] tracking-[0.06em] text-tif16-mut">USD</span>
</span>
</label>
</div><div class="tif-16 grid min-h-svh w-full place-items-center bg-tif16-bg px-6 py-14 font-tif16-sans" aria-label="Currency input demo">
<label class="grid w-full max-w-70 gap-1.5">
<span class="font-tif16-mono text-[10px] tracking-[0.12em] text-tif16-mut uppercase">Amount</span>
<span class="group flex items-center gap-1.5 rounded-[10px] border border-white/12 bg-tif16-field px-3.5 transition-[border-color,background-color] duration-200 focus-within:border-tif16-acc focus-within:bg-tif16-field2">
<span class="text-sm font-semibold text-tif16-mut transition-colors duration-200 group-focus-within:text-tif16-acc" aria-hidden="true">$</span>
<input type="text" name="tif16-amount" inputmode="decimal" pattern="[0-9.,]*" placeholder="0.00"
class="min-w-0 flex-1 border-0 bg-transparent py-3 text-right text-sm font-semibold tabular-nums text-tif16-ink outline-none placeholder:text-tif16-mut">
<span class="font-tif16-mono text-[10px] tracking-[0.06em] text-tif16-mut">USD</span>
</span>
</label>
</div>@import "tailwindcss";
@theme {
--color-tif16-bg: #12121a;
--color-tif16-bg: oklch(0.19 0.015 285);
--color-tif16-field: #1a1a22;
--color-tif16-field: oklch(0.23 0.015 285);
--color-tif16-field2: #1f1f2a;
--color-tif16-field2: oklch(0.26 0.018 285);
--color-tif16-ink: #f0eeff;
--color-tif16-ink: oklch(0.95 0.02 290);
--color-tif16-mut: #b8b6d4;
--color-tif16-mut: oklch(0.77 0.03 290);
--color-tif16-acc: #f5a84a;
--color-tif16-acc: oklch(0.79 0.13 70);
--font-tif16-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif16-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-16 {
width: 100%;
}
.tif-16 ::selection {
background: var(--color-tif16-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif16-bg: #12121a;
--color-tif16-bg: oklch(0.19 0.015 285);
--color-tif16-field: #1a1a22;
--color-tif16-field: oklch(0.23 0.015 285);
--color-tif16-field2: #1f1f2a;
--color-tif16-field2: oklch(0.26 0.018 285);
--color-tif16-ink: #f0eeff;
--color-tif16-ink: oklch(0.95 0.02 290);
--color-tif16-mut: #b8b6d4;
--color-tif16-mut: oklch(0.77 0.03 290);
--color-tif16-acc: #f5a84a;
--color-tif16-acc: oklch(0.79 0.13 70);
--font-tif16-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif16-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-16 {
width: 100%;
}
.tif-16 ::selection {
background: var(--color-tif16-acc);
color: #12121a;
}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-tif16-bg: #12121a;
--color-tif16-bg: oklch(0.19 0.015 285);
--color-tif16-field: #1a1a22;
--color-tif16-field: oklch(0.23 0.015 285);
--color-tif16-field2: #1f1f2a;
--color-tif16-field2: oklch(0.26 0.018 285);
--color-tif16-ink: #f0eeff;
--color-tif16-ink: oklch(0.95 0.02 290);
--color-tif16-mut: #b8b6d4;
--color-tif16-mut: oklch(0.77 0.03 290);
--color-tif16-acc: #f5a84a;
--color-tif16-acc: oklch(0.79 0.13 70);
--font-tif16-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif16-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-16 {
width: 100%;
}
.tif-16 ::selection {
background: var(--color-tif16-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif16-bg: #12121a;
--color-tif16-bg: oklch(0.19 0.015 285);
--color-tif16-field: #1a1a22;
--color-tif16-field: oklch(0.23 0.015 285);
--color-tif16-field2: #1f1f2a;
--color-tif16-field2: oklch(0.26 0.018 285);
--color-tif16-ink: #f0eeff;
--color-tif16-ink: oklch(0.95 0.02 290);
--color-tif16-mut: #b8b6d4;
--color-tif16-mut: oklch(0.77 0.03 290);
--color-tif16-acc: #f5a84a;
--color-tif16-acc: oklch(0.79 0.13 70);
--font-tif16-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif16-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-16 {
width: 100%;
}
.tif-16 ::selection {
background: var(--color-tif16-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&family=Plus+Jakarta+Sans:wght@400;500;600&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&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
tabular-numsmoved from the customisation list into the markup. It is the difference between a money field and a text field, not an optional extra.- The
-moz-appearance: textfieldand spin-button resets are gone withtype="number"— they were never needed on a text input. - The prefix's focus tint is
group-focus-within:rather than a descendant rule, so the shell's state is read once.
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 Currency Input
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-currency-input/
Right-aligned money with an inline $ that lights up on focus. tabular-nums keeps digit widths locked as the user types — the detail that makes a column of amounts stop shimmering.
## HTML
```html
<div class="tif-16 grid min-h-svh w-full place-items-center bg-tif16-bg px-6 py-14 font-tif16-sans" aria-label="Currency input demo">
<label class="grid w-full max-w-70 gap-1.5">
<span class="font-tif16-mono text-[10px] tracking-[0.12em] text-tif16-mut uppercase">Amount</span>
<span class="group flex items-center gap-1.5 rounded-[10px] border border-white/12 bg-tif16-field px-3.5 transition-[border-color,background-color] duration-200 focus-within:border-tif16-acc focus-within:bg-tif16-field2">
<span class="text-sm font-semibold text-tif16-mut transition-colors duration-200 group-focus-within:text-tif16-acc" aria-hidden="true">$</span>
<input type="text" name="tif16-amount" inputmode="decimal" pattern="[0-9.,]*" placeholder="0.00"
class="min-w-0 flex-1 border-0 bg-transparent py-3 text-right text-sm font-semibold tabular-nums text-tif16-ink outline-none placeholder:text-tif16-mut">
<span class="font-tif16-mono text-[10px] tracking-[0.06em] text-tif16-mut">USD</span>
</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif16-bg: #12121a;
--color-tif16-bg: oklch(0.19 0.015 285);
--color-tif16-field: #1a1a22;
--color-tif16-field: oklch(0.23 0.015 285);
--color-tif16-field2: #1f1f2a;
--color-tif16-field2: oklch(0.26 0.018 285);
--color-tif16-ink: #f0eeff;
--color-tif16-ink: oklch(0.95 0.02 290);
--color-tif16-mut: #b8b6d4;
--color-tif16-mut: oklch(0.77 0.03 290);
--color-tif16-acc: #f5a84a;
--color-tif16-acc: oklch(0.79 0.13 70);
--font-tif16-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif16-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-16 {
width: 100%;
}
.tif-16 ::selection {
background: var(--color-tif16-acc);
color: #12121a;
}
```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 Currency Input
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-currency-input/
Right-aligned money with an inline $ that lights up on focus. tabular-nums keeps digit widths locked as the user types — the detail that makes a column of amounts stop shimmering.
## HTML
```html
<div class="tif-16 grid min-h-svh w-full place-items-center bg-tif16-bg px-6 py-14 font-tif16-sans" aria-label="Currency input demo">
<label class="grid w-full max-w-70 gap-1.5">
<span class="font-tif16-mono text-[10px] tracking-[0.12em] text-tif16-mut uppercase">Amount</span>
<span class="group flex items-center gap-1.5 rounded-[10px] border border-white/12 bg-tif16-field px-3.5 transition-[border-color,background-color] duration-200 focus-within:border-tif16-acc focus-within:bg-tif16-field2">
<span class="text-sm font-semibold text-tif16-mut transition-colors duration-200 group-focus-within:text-tif16-acc" aria-hidden="true">$</span>
<input type="text" name="tif16-amount" inputmode="decimal" pattern="[0-9.,]*" placeholder="0.00"
class="min-w-0 flex-1 border-0 bg-transparent py-3 text-right text-sm font-semibold tabular-nums text-tif16-ink outline-none placeholder:text-tif16-mut">
<span class="font-tif16-mono text-[10px] tracking-[0.06em] text-tif16-mut">USD</span>
</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif16-bg: #12121a;
--color-tif16-bg: oklch(0.19 0.015 285);
--color-tif16-field: #1a1a22;
--color-tif16-field: oklch(0.23 0.015 285);
--color-tif16-field2: #1f1f2a;
--color-tif16-field2: oklch(0.26 0.018 285);
--color-tif16-ink: #f0eeff;
--color-tif16-ink: oklch(0.95 0.02 290);
--color-tif16-mut: #b8b6d4;
--color-tif16-mut: oklch(0.77 0.03 290);
--color-tif16-acc: #f5a84a;
--color-tif16-acc: oklch(0.79 0.13 70);
--font-tif16-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif16-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-16 {
width: 100%;
}
.tif-16 ::selection {
background: var(--color-tif16-acc);
color: #12121a;
}
```How this works
The prefix reads the field's state. group on the shell, one variant on the $:
<span class="text-tif16-mut transition-colors
group-focus-within:text-tif16-acc">$</span>Why not type="number". It strips leading zeros, rejects locale separators, mangles a pasted 1,234.56 and shows a spinner nobody wants on a price. inputmode="decimal" gets the mobile keypad without any of that.
Make it yours
- Symbol: the prefix span. For RTL currencies move it after the input and flip the text alignment.
- Formatting: format on blur with
Intl.NumberFormat, reparse on focus, keep the raw number in a hidden field. - Accent:
--color-tif16-acc. - Density:
py-3on the input,px-3.5on the shell.
Gotchas — read before shipping
- Store money as integer minor units server-side. Float arithmetic will embarrass you on the third item in a cart.
inputmode="decimal"needs iOS 12.5+ and Firefox 95+; older mobile browsers show the full keyboard, which is annoying but not broken.tabular-numsonly helps if the font has tabular figures — check before trusting it with a totals column.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
inputmode gates the mobile keypad; the visual chrome works everywhere Tailwind v4 does.