13 / 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 Phone Input With Country
A native <select> for the dialling code welded to a type="tel" field inside one focus ring. Semantic by default: the select is a real select, so iOS gives you the wheel and screen readers give you a listbox.
Untitled UI Pro: 5,000+ React + Tailwind CSS v4 components · from $349 one-time
Untitled UI React · Affiliate link
The code
<div class="tif-13 grid min-h-svh w-full place-items-center bg-tif13-bg px-6 py-14 font-tif13-sans" aria-label="Phone input with country demo">
<label class="grid w-full max-w-70 gap-1.5 text-[11px] text-tif13-mut">
<span class="font-semibold">Phone</span>
<span class="grid grid-cols-[auto_1fr] overflow-hidden rounded-lg border border-white/10 bg-tif13-field transition-[border-color,box-shadow] duration-200 focus-within:border-tif13-acc focus-within:ring-3 focus-within:ring-tif13-acc/15">
<select aria-label="Country code" name="tif13-country"
class="cursor-pointer appearance-none border-0 border-r border-white/10 bg-white/4 bg-[url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22 fill=%22none%22 stroke=%22%239d9bbf%22 stroke-width=%221.5%22 stroke-linecap=%22round%22><path d=%22M1 1l4 4 4-4%22/></svg>')] bg-[position:right_10px_center] bg-no-repeat py-2.5 pr-7 pl-3 text-[13px] text-tif13-ink outline-none [&>option]:bg-tif13-field [&>option]:text-tif13-ink">
<option value="+44">🇬🇧 +44</option>
<option value="+1" selected>🇺🇸 +1</option>
<option value="+91">🇮🇳 +91</option>
<option value="+33">🇫🇷 +33</option>
<option value="+49">🇩🇪 +49</option>
<option value="+81">🇯🇵 +81</option>
</select>
<input type="tel" name="tif13-phone" autocomplete="tel" placeholder="(555) 123-4567" required
class="min-w-0 border-0 bg-transparent px-3 py-2.5 text-sm text-tif13-ink outline-none placeholder:text-tif13-mut">
</span>
</label>
</div><div class="tif-13 grid min-h-svh w-full place-items-center bg-tif13-bg px-6 py-14 font-tif13-sans" aria-label="Phone input with country demo">
<label class="grid w-full max-w-70 gap-1.5 text-[11px] text-tif13-mut">
<span class="font-semibold">Phone</span>
<span class="grid grid-cols-[auto_1fr] overflow-hidden rounded-lg border border-white/10 bg-tif13-field transition-[border-color,box-shadow] duration-200 focus-within:border-tif13-acc focus-within:ring-3 focus-within:ring-tif13-acc/15">
<select aria-label="Country code" name="tif13-country"
class="cursor-pointer appearance-none border-0 border-r border-white/10 bg-white/4 bg-[url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22 fill=%22none%22 stroke=%22%239d9bbf%22 stroke-width=%221.5%22 stroke-linecap=%22round%22><path d=%22M1 1l4 4 4-4%22/></svg>')] bg-[position:right_10px_center] bg-no-repeat py-2.5 pr-7 pl-3 text-[13px] text-tif13-ink outline-none [&>option]:bg-tif13-field [&>option]:text-tif13-ink">
<option value="+44">🇬🇧 +44</option>
<option value="+1" selected>🇺🇸 +1</option>
<option value="+91">🇮🇳 +91</option>
<option value="+33">🇫🇷 +33</option>
<option value="+49">🇩🇪 +49</option>
<option value="+81">🇯🇵 +81</option>
</select>
<input type="tel" name="tif13-phone" autocomplete="tel" placeholder="(555) 123-4567" required
class="min-w-0 border-0 bg-transparent px-3 py-2.5 text-sm text-tif13-ink outline-none placeholder:text-tif13-mut">
</span>
</label>
</div>@import "tailwindcss";
@theme {
--color-tif13-bg: #12121a;
--color-tif13-bg: oklch(0.19 0.015 285);
--color-tif13-field: #1a1a22;
--color-tif13-field: oklch(0.23 0.015 285);
--color-tif13-ink: #f0eeff;
--color-tif13-ink: oklch(0.95 0.02 290);
--color-tif13-mut: #b8b6d4;
--color-tif13-mut: oklch(0.77 0.03 290);
--color-tif13-acc: #ef4444;
--color-tif13-acc: oklch(0.63 0.22 27);
--font-tif13-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-13 {
width: 100%;
}
.tif-13 ::selection {
background: var(--color-tif13-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif13-bg: #12121a;
--color-tif13-bg: oklch(0.19 0.015 285);
--color-tif13-field: #1a1a22;
--color-tif13-field: oklch(0.23 0.015 285);
--color-tif13-ink: #f0eeff;
--color-tif13-ink: oklch(0.95 0.02 290);
--color-tif13-mut: #b8b6d4;
--color-tif13-mut: oklch(0.77 0.03 290);
--color-tif13-acc: #ef4444;
--color-tif13-acc: oklch(0.63 0.22 27);
--font-tif13-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-13 {
width: 100%;
}
.tif-13 ::selection {
background: var(--color-tif13-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-tif13-bg: #12121a;
--color-tif13-bg: oklch(0.19 0.015 285);
--color-tif13-field: #1a1a22;
--color-tif13-field: oklch(0.23 0.015 285);
--color-tif13-ink: #f0eeff;
--color-tif13-ink: oklch(0.95 0.02 290);
--color-tif13-mut: #b8b6d4;
--color-tif13-mut: oklch(0.77 0.03 290);
--color-tif13-acc: #ef4444;
--color-tif13-acc: oklch(0.63 0.22 27);
--font-tif13-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-13 {
width: 100%;
}
.tif-13 ::selection {
background: var(--color-tif13-acc);
color: #12121a;
}@import "tailwindcss";
@theme {
--color-tif13-bg: #12121a;
--color-tif13-bg: oklch(0.19 0.015 285);
--color-tif13-field: #1a1a22;
--color-tif13-field: oklch(0.23 0.015 285);
--color-tif13-ink: #f0eeff;
--color-tif13-ink: oklch(0.95 0.02 290);
--color-tif13-mut: #b8b6d4;
--color-tif13-mut: oklch(0.77 0.03 290);
--color-tif13-acc: #ef4444;
--color-tif13-acc: oklch(0.63 0.22 27);
--font-tif13-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-13 {
width: 100%;
}
.tif-13 ::selection {
background: var(--color-tif13-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=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=Plus+Jakarta+Sans:wght@400;500;600&display=swap">What changed in the port
Which parts became utilities, which stayed CSS, and why.
- The
select optionrule becomes[&>option]:bg-*on the select — Firefox needs it, and it is now visible where the select is declared. -webkit-appearancedisappears: Tailwind'sappearance-noneemits both.- The shell keeps
overflow-hiddenso neither child needs a radius, which is one fewer pair of numbers to keep matched.
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 Phone Input With Country
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-phone-input-with-country/
A native <select> for the dialling code welded to a type="tel" field inside one focus ring. Semantic by default: the select is a real select, so iOS gives you the wheel and screen readers give you a listbox.
## HTML
```html
<div class="tif-13 grid min-h-svh w-full place-items-center bg-tif13-bg px-6 py-14 font-tif13-sans" aria-label="Phone input with country demo">
<label class="grid w-full max-w-70 gap-1.5 text-[11px] text-tif13-mut">
<span class="font-semibold">Phone</span>
<span class="grid grid-cols-[auto_1fr] overflow-hidden rounded-lg border border-white/10 bg-tif13-field transition-[border-color,box-shadow] duration-200 focus-within:border-tif13-acc focus-within:ring-3 focus-within:ring-tif13-acc/15">
<select aria-label="Country code" name="tif13-country"
class="cursor-pointer appearance-none border-0 border-r border-white/10 bg-white/4 bg-[url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22 fill=%22none%22 stroke=%22%239d9bbf%22 stroke-width=%221.5%22 stroke-linecap=%22round%22><path d=%22M1 1l4 4 4-4%22/></svg>')] bg-[position:right_10px_center] bg-no-repeat py-2.5 pr-7 pl-3 text-[13px] text-tif13-ink outline-none [&>option]:bg-tif13-field [&>option]:text-tif13-ink">
<option value="+44">🇬🇧 +44</option>
<option value="+1" selected>🇺🇸 +1</option>
<option value="+91">🇮🇳 +91</option>
<option value="+33">🇫🇷 +33</option>
<option value="+49">🇩🇪 +49</option>
<option value="+81">🇯🇵 +81</option>
</select>
<input type="tel" name="tif13-phone" autocomplete="tel" placeholder="(555) 123-4567" required
class="min-w-0 border-0 bg-transparent px-3 py-2.5 text-sm text-tif13-ink outline-none placeholder:text-tif13-mut">
</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif13-bg: #12121a;
--color-tif13-bg: oklch(0.19 0.015 285);
--color-tif13-field: #1a1a22;
--color-tif13-field: oklch(0.23 0.015 285);
--color-tif13-ink: #f0eeff;
--color-tif13-ink: oklch(0.95 0.02 290);
--color-tif13-mut: #b8b6d4;
--color-tif13-mut: oklch(0.77 0.03 290);
--color-tif13-acc: #ef4444;
--color-tif13-acc: oklch(0.63 0.22 27);
--font-tif13-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-13 {
width: 100%;
}
.tif-13 ::selection {
background: var(--color-tif13-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 Phone Input With Country
Source: https://codefronts.com/components/tailwind-css-input-fields/tailwind-phone-input-with-country/
A native <select> for the dialling code welded to a type="tel" field inside one focus ring. Semantic by default: the select is a real select, so iOS gives you the wheel and screen readers give you a listbox.
## HTML
```html
<div class="tif-13 grid min-h-svh w-full place-items-center bg-tif13-bg px-6 py-14 font-tif13-sans" aria-label="Phone input with country demo">
<label class="grid w-full max-w-70 gap-1.5 text-[11px] text-tif13-mut">
<span class="font-semibold">Phone</span>
<span class="grid grid-cols-[auto_1fr] overflow-hidden rounded-lg border border-white/10 bg-tif13-field transition-[border-color,box-shadow] duration-200 focus-within:border-tif13-acc focus-within:ring-3 focus-within:ring-tif13-acc/15">
<select aria-label="Country code" name="tif13-country"
class="cursor-pointer appearance-none border-0 border-r border-white/10 bg-white/4 bg-[url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22 viewBox=%220 0 10 6%22 fill=%22none%22 stroke=%22%239d9bbf%22 stroke-width=%221.5%22 stroke-linecap=%22round%22><path d=%22M1 1l4 4 4-4%22/></svg>')] bg-[position:right_10px_center] bg-no-repeat py-2.5 pr-7 pl-3 text-[13px] text-tif13-ink outline-none [&>option]:bg-tif13-field [&>option]:text-tif13-ink">
<option value="+44">🇬🇧 +44</option>
<option value="+1" selected>🇺🇸 +1</option>
<option value="+91">🇮🇳 +91</option>
<option value="+33">🇫🇷 +33</option>
<option value="+49">🇩🇪 +49</option>
<option value="+81">🇯🇵 +81</option>
</select>
<input type="tel" name="tif13-phone" autocomplete="tel" placeholder="(555) 123-4567" required
class="min-w-0 border-0 bg-transparent px-3 py-2.5 text-sm text-tif13-ink outline-none placeholder:text-tif13-mut">
</span>
</label>
</div>
```
## CSS
```css
@import "tailwindcss";
@theme {
--color-tif13-bg: #12121a;
--color-tif13-bg: oklch(0.19 0.015 285);
--color-tif13-field: #1a1a22;
--color-tif13-field: oklch(0.23 0.015 285);
--color-tif13-ink: #f0eeff;
--color-tif13-ink: oklch(0.95 0.02 290);
--color-tif13-mut: #b8b6d4;
--color-tif13-mut: oklch(0.77 0.03 290);
--color-tif13-acc: #ef4444;
--color-tif13-acc: oklch(0.63 0.22 27);
--font-tif13-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.tif-13 {
width: 100%;
}
.tif-13 ::selection {
background: var(--color-tif13-acc);
color: #12121a;
}
```How this works
Two controls, one field. The shell owns the border, the radius and the focus ring; the children own nothing but their own padding:
class="grid grid-cols-[auto_1fr] overflow-hidden rounded-lg border
focus-within:border-tif13-acc focus-within:ring-3"The select stays native. type="tel" raises the numeric keypad without imposing a format, and real E.164 validation belongs on submit with libphonenumber-js — this is the UI shell that MFA flows sit behind, not the validator.
Make it yours
- Countries: the
optionlist, with the dial code invalue. - Accent:
--color-tif13-accdrives border and ring. - Chevron: recolour the
strokeinside the data URI — it is notcurrentColor-able in a background image. - Width: drop
max-w-70and the field fills a checkout column.
Gotchas — read before shipping
type="tel"validates nothing. Treat the value as free text until a real parser has seen it.- Flag emoji render as monochrome boxes on Windows Chrome; ship an SVG sprite if that audience matters.
- iOS renders
selectas a full-screen wheel. You can style the closed state and nothing else.
Browser support
| Chrome | Safari | Firefox | Edge |
|---|---|---|---|
| 111+ | 16.4+ | 128+ | 111+ |
tel input and select are universal; only the appearance-none chevron needs a modern engine.