22 / 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 Auto-Grow Textarea
A textarea that grows with its content and shrinks back — one utility, field-sizing-content, replacing the ResizeObserver-and-hidden-mirror dance every form library used to ship.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<div class="tif-22 grid min-h-svh w-full place-items-center bg-tif22-bg px-6 py-14 font-tif22-sans" aria-label="Auto-grow textarea demo">
<label class="grid w-full max-w-80 gap-1.5">
<span class="font-tif22-mono text-[10px] tracking-[0.12em] text-tif22-mut uppercase">Notes</span>
<textarea name="tif22-notes" rows="2" placeholder="Type as much as you need…"
class="field-sizing-content max-h-60 min-h-16 w-full resize-none overflow-y-auto rounded-[10px] border border-white/12 bg-tif22-field px-3.5 py-3 text-sm font-medium leading-relaxed text-tif22-ink outline-none transition-[border-color,background-color] duration-200 placeholder:text-tif22-mut focus:border-tif22-acc focus:bg-tif22-field2"></textarea>
<span class="text-[11px] text-tif22-mut">Field grows as you type</span>
</label>
</div><div class="tif-22 grid min-h-svh w-full place-items-center bg-tif22-bg px-6 py-14 font-tif22-sans" aria-label="Auto-grow textarea demo">
<label class="grid w-full max-w-80 gap-1.5">
<span class="font-tif22-mono text-[10px] tracking-[0.12em] text-tif22-mut uppercase">Notes</span>
<textarea name="tif22-notes" rows="2" placeholder="Type as much as you need…"
class="field-sizing-content max-h-60 min-h-16 w-full resize-none overflow-y-auto rounded-[10px] border border-white/12 bg-tif22-field px-3.5 py-3 text-sm font-medium leading-relaxed text-tif22-ink outline-none transition-[border-color,background-color] duration-200 placeholder:text-tif22-mut focus:border-tif22-acc focus:bg-tif22-field2"></textarea>
<span class="text-[11px] text-tif22-mut">Field grows as you type</span>
</label>
</div>@import "tailwindcss";
@theme {
--color-tif22-bg: #12121a;
--color-tif22-bg: oklch(0.19 0.015 285);
--color-tif22-field: #1a1a22;
--color-tif22-field: oklch(0.23 0.015 285);
--color-tif22-field2: #1f1f2a;
--color-tif22-field2: oklch(0.26 0.018 285);
--color-tif22-ink: #f0eeff;
--color-tif22-ink: oklch(0.95 0.02 290);
--color-tif22-mut: #b8b6d4;
--color-tif22-mut: oklch(0.77 0.03 290);
--color-tif22-acc: #a78bfa;
--color-tif22-acc: oklch(0.74 0.15 295);
--font-tif22-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif22-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-22 {
width: 100%;
}
.tif-22 ::selection {
background: var(--color-tif22-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif22-bg: #12121a;
--color-tif22-bg: oklch(0.19 0.015 285);
--color-tif22-field: #1a1a22;
--color-tif22-field: oklch(0.23 0.015 285);
--color-tif22-field2: #1f1f2a;
--color-tif22-field2: oklch(0.26 0.018 285);
--color-tif22-ink: #f0eeff;
--color-tif22-ink: oklch(0.95 0.02 290);
--color-tif22-mut: #b8b6d4;
--color-tif22-mut: oklch(0.77 0.03 290);
--color-tif22-acc: #a78bfa;
--color-tif22-acc: oklch(0.74 0.15 295);
--font-tif22-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif22-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-22 {
width: 100%;
}
.tif-22 ::selection {
background: var(--color-tif22-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-tif22-bg: #12121a;
--color-tif22-bg: oklch(0.19 0.015 285);
--color-tif22-field: #1a1a22;
--color-tif22-field: oklch(0.23 0.015 285);
--color-tif22-field2: #1f1f2a;
--color-tif22-field2: oklch(0.26 0.018 285);
--color-tif22-ink: #f0eeff;
--color-tif22-ink: oklch(0.95 0.02 290);
--color-tif22-mut: #b8b6d4;
--color-tif22-mut: oklch(0.77 0.03 290);
--color-tif22-acc: #a78bfa;
--color-tif22-acc: oklch(0.74 0.15 295);
--font-tif22-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif22-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-22 {
width: 100%;
}
.tif-22 ::selection {
background: var(--color-tif22-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif22-bg: #12121a;
--color-tif22-bg: oklch(0.19 0.015 285);
--color-tif22-field: #1a1a22;
--color-tif22-field: oklch(0.23 0.015 285);
--color-tif22-field2: #1f1f2a;
--color-tif22-field2: oklch(0.26 0.018 285);
--color-tif22-ink: #f0eeff;
--color-tif22-ink: oklch(0.95 0.02 290);
--color-tif22-mut: #b8b6d4;
--color-tif22-mut: oklch(0.77 0.03 290);
--color-tif22-acc: #a78bfa;
--color-tif22-acc: oklch(0.74 0.15 295);
--font-tif22-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif22-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-22 {
width: 100%;
}
.tif-22 ::selection {
background: var(--color-tif22-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.
field-sizing: contenthas a first-class utility in v4 — the port is shorter than the original stylesheet by about thirty lines.- A
max-h-60ceiling was added; the CSS original mentions it only as a customisation, and without it a long paste is a layout bug. - Everything else — padding, radius, focus tint — is the same vocabulary as every other field here, which is the argument for utilities in one sentence.
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 Auto-Grow Textarea
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-auto-grow-textarea/
A textarea that grows with its content and shrinks back — one utility, field-sizing-content, replacing the ResizeObserver-and-hidden-mirror dance every form library used to ship.
## HTML
```html
<div class="tif-22 grid min-h-svh w-full place-items-center bg-tif22-bg px-6 py-14 font-tif22-sans" aria-label="Auto-grow textarea demo">
<label class="grid w-full max-w-80 gap-1.5">
<span class="font-tif22-mono text-[10px] tracking-[0.12em] text-tif22-mut uppercase">Notes</span>
<textarea name="tif22-notes" rows="2" placeholder="Type as much as you need…"
class="field-sizing-content max-h-60 min-h-16 w-full resize-none overflow-y-auto rounded-[10px] border border-white/12 bg-tif22-field px-3.5 py-3 text-sm font-medium leading-relaxed text-tif22-ink outline-none transition-[border-color,background-color] duration-200 placeholder:text-tif22-mut focus:border-tif22-acc focus:bg-tif22-field2"></textarea>
<span class="text-[11px] text-tif22-mut">Field grows as you type</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif22-bg: #12121a;
--color-tif22-bg: oklch(0.19 0.015 285);
--color-tif22-field: #1a1a22;
--color-tif22-field: oklch(0.23 0.015 285);
--color-tif22-field2: #1f1f2a;
--color-tif22-field2: oklch(0.26 0.018 285);
--color-tif22-ink: #f0eeff;
--color-tif22-ink: oklch(0.95 0.02 290);
--color-tif22-mut: #b8b6d4;
--color-tif22-mut: oklch(0.77 0.03 290);
--color-tif22-acc: #a78bfa;
--color-tif22-acc: oklch(0.74 0.15 295);
--font-tif22-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif22-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-22 {
width: 100%;
}
.tif-22 ::selection {
background: var(--color-tif22-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 Auto-Grow Textarea
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-auto-grow-textarea/
A textarea that grows with its content and shrinks back — one utility, field-sizing-content, replacing the ResizeObserver-and-hidden-mirror dance every form library used to ship.
## HTML
```html
<div class="tif-22 grid min-h-svh w-full place-items-center bg-tif22-bg px-6 py-14 font-tif22-sans" aria-label="Auto-grow textarea demo">
<label class="grid w-full max-w-80 gap-1.5">
<span class="font-tif22-mono text-[10px] tracking-[0.12em] text-tif22-mut uppercase">Notes</span>
<textarea name="tif22-notes" rows="2" placeholder="Type as much as you need…"
class="field-sizing-content max-h-60 min-h-16 w-full resize-none overflow-y-auto rounded-[10px] border border-white/12 bg-tif22-field px-3.5 py-3 text-sm font-medium leading-relaxed text-tif22-ink outline-none transition-[border-color,background-color] duration-200 placeholder:text-tif22-mut focus:border-tif22-acc focus:bg-tif22-field2"></textarea>
<span class="text-[11px] text-tif22-mut">Field grows as you type</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif22-bg: #12121a;
--color-tif22-bg: oklch(0.19 0.015 285);
--color-tif22-field: #1a1a22;
--color-tif22-field: oklch(0.23 0.015 285);
--color-tif22-field2: #1f1f2a;
--color-tif22-field2: oklch(0.26 0.018 285);
--color-tif22-ink: #f0eeff;
--color-tif22-ink: oklch(0.95 0.02 290);
--color-tif22-mut: #b8b6d4;
--color-tif22-mut: oklch(0.77 0.03 290);
--color-tif22-acc: #a78bfa;
--color-tif22-acc: oklch(0.74 0.15 295);
--font-tif22-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
--font-tif22-mono: 'JetBrains Mono', ui-monospace, monospace;
}
.tif-22 {
width: 100%;
}
.tif-22 ::selection {
background: var(--color-tif22-acc);
color: #12121a;
}
```How this works
One declaration, whole feature. field-sizing: content tells the browser to size the box to its text instead of the rows attribute:
class="field-sizing-content min-h-16 max-h-60 resize-none overflow-y-auto"Bounds are still yours. The property takes only content or fixed, so a floor and a ceiling are ordinary min-h-*/max-h-* — without the ceiling a long paste pushes your submit button off the screen.
Make it yours
- Ceiling:
max-h-60, paired withoverflow-y-autoso long input scrolls. - Resting size:
min-h-16or therowsattribute — both act as a floor. - Accent:
--color-tif22-accon focus. - Rhythm:
leading-relaxedgives each new line more room to arrive into.
Gotchas — read before shipping
- Chrome 123+, Safari 26+, Firefox 137+. Older browsers sit at
rows="2"— a graceful fallback, but not auto-grow. - Growth shifts everything below it. Put the textarea in a grid or flex container that tolerates height changes.
resize-noneremoves the manual grip; if support is missing, the user now has neither growth nor a grip. Keeprowsgenerous.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 123+ | 26+ | 137+ | 123+ |
field-sizing is newly Baseline-ish; below these versions the textarea is a normal fixed-rows field.