28 hand-coded CSS input fields for sign-up, checkout, SaaS onboarding, and HIPAA portalsfloating label, notched outline, :has()-driven password strength, 6-digit OTP, tag chip, inline edit, voice search, credit card formatter, and field-sizing: content autogrow textarea. 18 pure CSS + 10 vanilla JS with native form semantics (correct autocomplete tokens) so password managers and iOS SMS autofill just work. Scoped under .if-NN for no-collision pasting, prefers-reduced-motion guarded, framework-agnostic.

18 pure CSS10 light JSPublished

Related20 CSS Form Validation16 CSS Floating Label Inputs30 CSS Login Forms20 CSS Custom Select Dropdowns

Floating Label — preview
01 / 28Pure CSS

Floating Label

Classic floating label input. The placeholder lifts and shrinks above the field on focus — a calm, accessible pattern used across every modern product surface.

Published

Underline Sweep — preview
02 / 28Pure CSS

Underline Sweep

Minimal underline-style input. The bottom border draws outward from the centre on focus — a subtle, premium touch driven by :focus-within.

Published

Neon Glow — preview
03 / 28Pure CSS

Neon Glow

Cyan neon-glow input. The border crisps and the box-shadow blooms on focus — perfect for dark dashboards, gaming UIs, and developer tools.

Published

Glass Frosted — preview
04 / 28Pure CSS

Glass Frosted

Frosted-glass input on a soft gradient. Translucent surface with backdrop-filter blur and an inner highlight — an elegant fit for hero sections.

Published

Notched Outline — preview
05 / 28Pure CSS

Notched Outline

Material-style notched outline. The label sits inside a gap cut into the border. Subtle, professional, and works beautifully for forms with dense fields.

Published

Liquid Border — preview
06 / 28Pure CSS

Liquid Border

Animated stroke that draws around the field on focus. A small flourish that makes a single text input feel deliberate and premium.

Published

Inline Validation — preview
07 / 28Pure CSS

Inline Validation

Live :valid / :invalid feedback. Green tick when correct, red cross when not — driven by :has() and pseudo-elements, no JavaScript required.

Published

Search with Clear — preview
08 / 28Pure CSS

Search with Clear

Search input with a leading magnifier icon and a trailing clear button. The clear control appears only when the field has content — handled with :placeholder-shown.

Published

Password Strength — preview
09 / 28Pure CSS

Password Strength

Sign-up password input with a live strength bar that grades red → amber → green. Driven by :has(input:valid/:invalid) — zero scoring JavaScript.

Published

OTP Code — preview
10 / 28Light JS

OTP Code

One-time-passcode entry split across six boxes inside a single <fieldset>. Auto-advance, backspace step-back, and full paste-to-fill — autocomplete="one-time-code" drives SMS auto-suggest.

Published

Rotating Placeholder — preview
11 / 28Light JS

Rotating Placeholder

The native placeholder attribute itself rotates through four sample queries every 2.5 seconds — "Search products…" → "Search docs…" → "Search people…" → "Search settings…". Light JS swaps the attribute; the browser does the rest. Stops the moment the user focuses or starts typing.

Published

Tag Input — preview
12 / 28Light JS

Tag Input

Type a tag and press Enter or comma to commit it as a chip. Backspace on an empty input removes the last chip — a polished pattern for filters and email recipients.

Published

Phone with Country — preview
13 / 28Pure CSS

Phone with Country

Phone number input with a native <select> for the country dialling code. Semantic, accessible by default, and styled to match the input seamlessly.

Published

Stepper Number — preview
14 / 28Light JS

Stepper Number

Quantity input with custom −/+ controls. Native <input type="number"> underneath keeps keyboard arrows, validation, and screen-reader semantics intact.

Published

File Drop Zone — preview
15 / 28Pure CSS

File Drop Zone

Drag-and-drop file input with a custom dashed boundary. Native <input type="file"> underneath, the visible filename appearing via :has() — accessible, keyboard-friendly, and minimal.

Published

Currency Input — preview
16 / 28Pure CSS

Currency Input

Right-aligned numeric input with an inline $ prefix. inputmode="decimal" brings up the right mobile keyboard; :focus-within lights the prefix to match the field accent.

Published

Date Picker Native — preview
17 / 28Pure CSS

Date Picker Native

A styled <input type="date"> keeps every native picker behaviour (keyboard, accessibility, browser/OS calendars) while the chrome matches the rest of your form. ::-webkit-calendar-picker-indicator is recoloured to match the accent.

Published

Time Range — preview
18 / 28Pure CSS

Time Range

Two <input type="time"> paired with a typographic divider. Single visual unit while remaining two independent fields for keyboard nav and form submission.

Published

Color Picker — preview
19 / 28Pure CSS

Color Picker

A <input type="color"> swatch chip paired with a hex text field — both accept the same name and submit value via the underlying form. Sibling-+ selectors mirror the swatch state.

Published

Search with Voice — preview
20 / 28Light JS

Search with Voice

Search field with a microphone trigger that toggles a recording state — pulses a halo while "listening". Real <input type="search"> so AT announces it as a search field.

Published

Email with Suggestions — preview
21 / 28Light JS

Email with Suggestions

When the user types @, common email domains are suggested in a keyboard-navigable dropdown. aria-controls + aria-expanded + role="listbox" make it a proper combobox.

Published

Auto-Grow Textarea — preview
22 / 28Pure CSS

Auto-Grow Textarea

A multi-line <textarea> that grows with its content using field-sizing: content — no JS observer needed. Falls back to a min-height on browsers without support.

Published

Inline Edit — preview
23 / 28Light JS

Inline Edit

Click-to-edit text that swaps between a static value and an editable input. Saves on Enter, cancels on Escape, blurs to commit — the canonical pattern from Notion and Linear.

Published

Range Slider Pro — preview
24 / 28Light JS

Range Slider Pro

A native <input type="range"> with custom track/thumb styling and a live value bubble that follows the thumb. Honest accessibility — keyboard arrows, screen-reader announcement, real form value.

Published

URL with Protocol — preview
25 / 28Pure CSS

URL with Protocol

URL input with a non-editable https:// prefix that visually integrates with the field. Submit value is the full URL; users only type the host portion.

Published

Credit Card — preview
26 / 28Light JS

Credit Card

Auto-formatted 16-digit card number with brand-aware accent (Visa, Mastercard, Amex). inputmode="numeric" on mobile; pattern validation; autocomplete="cc-number".

Published

Toggle Password — preview
27 / 28Light JS

Toggle Password

Password field with an eye toggle that swaps type="password"type="text". aria-pressed reflects state for screen readers; autocomplete="new-password" for sign-up flows.

Published

Brutalist Input — preview
28 / 28Pure CSS

Brutalist Input

Bold offset-shadow stamp with hard edges and monospace type — a confident input that doesn't apologize for itself. Press collapses into the shadow on focus.

Published

FAQ

Frequently asked questions

How do I style a CSS input field?
Style the native input element directly using its tag plus a class. Reset border, padding, background and font with a single rule, then add :focus and :focus-within states for the active look. Use :placeholder-shown to detect empty fields, :has() to react to descendant state, and :valid / :invalid for live validation feedback — all without JavaScript. Every demo in this gallery is scoped under a per-demo .if-NN numeric class prefix (matching the css-tooltips/css-tabs standard) so multiple field styles can coexist on one page without cross-contamination, and every root uses semantic HTML (real input, textarea, and label elements) so screen readers and password managers work as expected.
Are these CSS input fields accessible?
Yes. Every demo uses a real native input or textarea, paired with a real label (either visible or visually-hidden via .sr-only). Autocomplete attributes are set correctly (email, current-password, new-password, one-time-code, cc-number, tel) so password managers and SMS autofill work. Focus states are visible via :focus-visible (not :focus, which fires on mouse click too), keyboard navigation is the default browser behaviour, WCAG 2.1 SC 2.5.5 44×44px touch targets are respected on every clickable region, and rotating placeholders honour SC 2.2.2 by pausing on focus. Toggle buttons carry aria-pressed instead of aria-checked (SC 4.1.2), and inline validation uses :user-invalid where supported so the red state only appears after the user has interacted with the field.
What's the most accessible way to do a floating label?
Keep the label as a real label element associated with the input via for=id. Drive the floated state with the :placeholder-shown pseudo-class — the label moves up when the input is non-empty or focused. This way assistive tech still announces the label as the input's accessible name. The demo also needs placeholder=" " (a single space) on the input; an empty placeholder attribute breaks :placeholder-shown and the label stays permanently lifted. Do not swap the label for placeholder-only text — placeholders vanish on type and are not announced as accessible names by screen readers, which fails WCAG 3.3.2 (Labels or Instructions).
Do these inputs need JavaScript?
Most don't — 18 of the 28 are pure CSS using :focus-within, :placeholder-shown, :valid, :has() and adjacent-sibling selectors. The other 10 (OTP, tag chip, inline edit, voice search, email suggestions, credit card formatter, stepper number, range slider, rotating placeholder, password toggle) include small self-contained JS snippets in the JS tab of the code panel. Every JS snippet is vanilla — no framework, no library — and runs standalone when copied into a fresh HTML file. The 10 JS demos are also the only ones that need JS: everything else uses native form pseudo-classes.
Will autofill and password managers work with these inputs?
Yes. Each input keeps the native element with the correct type and autocomplete attribute. The custom styling never breaks 1Password, Bitwarden, Chrome autofill, or Safari's SMS auto-suggestion. The critical autocomplete values are email for email fields, current-password for sign-in, new-password for sign-up plus password reset, one-time-code for OTP entry (iOS Safari 12+ surfaces the SMS suggestion natively), cc-number / cc-exp / cc-csc for credit card fields, tel for phone numbers, and cc-name for cardholder name. Never blank out or misspell autocomplete — password managers silently skip inputs they can't classify, and iOS SMS OTP autofill silently fails without the exact one-time-code token.
How do I build a HIPAA patient intake form or healthcare portal signup with these input fields?
Healthcare intake forms carry a distinct set of compliance requirements on top of accessibility: (1) HIPAA 45 CFR § 164.312 requires access controls, audit logs, and encryption in transit and at rest — the client-side form is only one piece of that story, and the demos here handle the UI layer only. (2) 21st Century Cures Act information-blocking rules require patient-portal fields to not obscure prescription cost, insurance status, or provider network — never hide these behind a collapsed input group. (3) State telehealth laws (California AB 1000, New York PHL § 4903, Texas OccCode § 111) require jurisdiction disclosures on the signup surface — use the tag chip input (Demo 12) to let patients declare their state, or the phone-with-country input (Demo 13) for interstate telehealth pipelines. (4) ADA Title III accessibility applies to healthcare portals — every demo in this collection uses semantic HTML, WCAG 2.1 SC 2.5.5 tap targets, and :focus-visible rings so patients with mobility or vision disabilities can complete forms without a keyboard trap. For patient-facing password fields (Demo 09 Password Strength + Demo 27 Toggle Password), pair with 21st Century Cures Act patient-access requirements — never enforce a password complexity rule that would lock out patients using assistive tech dictation. NIST 800-63B guidance since 2017 explicitly recommends allowing paste in password fields and removing complexity requirements in favour of length. Every high-CPM tier-1 healthcare vertical (Epic MyChart, Teladoc, Zocdoc, One Medical, Hims/Hers, Ro) has a patient-intake form as the highest-conversion surface on their marketing site, and this collection carries the input primitives you need to build one that stays HIPAA-defensible and WCAG-compliant.
Which input field pattern fits a Stripe / Shopify / WooCommerce e-commerce checkout?
E-commerce checkout carries three high-value input patterns from this collection: (1) Demo 26 Credit Card auto-formatter — inserts a space after every four digits, detects the brand from the BIN prefix (Visa ^4, Mastercard ^5[1-5] or ^2[2-7], Amex ^3[47], Discover ^6(011|5)), and carries autocomplete="cc-number" for iOS/Android saved-card autofill. Critical: PCI DSS SAQ-A requires that a raw PAN never touches your server — ship this UI only inside Stripe Elements, Braintree Hosted Fields, Adyen HostedFields, or Checkout.com Frames iframes. The demo is styling education, not a production PAN field. (2) Demo 16 Currency Input — the tabular-nums pattern with a currency prefix inside the field, used across Stripe Checkout line items, Shopify Cart drawer totals, and WooCommerce order-summary rows. Store amounts as integer cents server-side; never do float math on 0.1 + 0.2. (3) Demo 14 Stepper Number — the cart quantity control with plus/minus buttons that clamps to min/max via ValidityState and announces the new count to screen readers via aria-live="polite". Combined, these three inputs plus Demo 08 Search with Clear (product search) and Demo 04 Glass Frosted or Demo 05 Notched Outline (coupon code entry) give you the entire checkout input primitive set. Shopify Dawn theme, WooCommerce Storefront, BigCommerce Cornerstone, and Stripe Checkout all use variants of these patterns. E-commerce checkout carries $3-7 CPM standalone but $15-25 CPM once combined with the actual add-to-cart or purchase intent.
Which input field pattern fits a SaaS signup, Stripe Atlas onboarding, or Notion / Linear / Vercel product tour?
SaaS signup flows have converged on a small vocabulary from this collection: (1) Demo 01 Floating Label or Demo 05 Notched Outline for name + email — the calm Material pattern most SaaS marketing pages use. (2) Demo 09 Password Strength Meter for new-password fields with a live red-amber-green grade driven by :has() and native validity — no zxcvbn dependency, no bundle-size hit. Pair with Demo 27 Toggle Password so users can verify they typed the right value before submitting (Stripe / Vercel / Linear / Superhuman all ship this). (3) Demo 10 OTP Code for magic-link email verification and MFA — the six-box widget with autocomplete="one-time-code" that iOS Safari surfaces above the keyboard when the SMS arrives, and the Stripe-style paste handler that accepts "123456", "123-456", or "code: 123 456" alike. (4) Demo 12 Tag Input for teammate invites — the Notion / Linear / GitHub pattern with Enter-to-commit and Backspace-to-remove. (5) Demo 21 Email with Suggestions to autocomplete the domain part after @ — the @gmail.com / @outlook.com / @hey.com / @proton.me list boosts completion rates by roughly 20% on tier-1 signup forms per Baymard onboarding research. (6) Demo 23 Inline Edit for workspace / team-name renaming — the Notion / Linear / Asana / Airtable pattern with blur-to-save and Escape-to-cancel. Together this stack replaces react-hook-form + react-otp-input + react-tag-input + react-password-strength-bar + react-select-async + inline-edit-react (about 180KB combined) with 10-30 lines of vanilla JS per field. SaaS signup carries $8-15 CPM in the tier-1 US/CA/UK/AU/NZ market, higher for fintech-adjacent SaaS (Ramp, Brex, Stripe Atlas, Mercury) which touch $25-45 CPM once the visitor lands the tools plan page.

Related collections

15 CSS 3D Tilt Hover Cards preview

15 CSS 3D Tilt Hover Cards

15 mouse-aware 3D tilt hover cards — e-commerce product spotlight, glassmorphism parallax team card, interactive pricing tier, holographic NFT collectible, pop-out mascot, dark tech grid with border glow, media player album art, blog article preview, cyberpunk neon glow, dashboard KPI widget, minimalist real estate, flip-to-back tilt, mobile app showcase, course learning card, and a Pure CSS touch-friendly tilt. Vanilla JS writes --rx/--ry/--mx/--my; all rendering stays in CSS on the GPU.

24 CSS Animated Cards preview

24 CSS Animated Cards

24 hand-coded CSS animated card patterns organised by what triggers the motion, not by card style. Scroll and entrance triggers: staggered grid reveals, @starting-style mount-in, scroll-driven scale and fade on animation-timeline: view(), View Transitions API card-to-detail morphs, blur-to-sharp lazy image loading, and FLIP re-layout when a filter changes. State-change triggers: add-to-cart success morph, like and save particle burst, expand and collapse to intrinsic height with calc-size(), swipe-to-dismiss on Pointer Events, and skeleton-to-loaded crossfade. Data-driven triggers: count-up KPI metrics, SVG sparkline draw-on-enter, and progress ring fill on load. Ambient idle loops: breathing glow, floating drift, animated gradient mesh backgrounds, conic rotating borders, auto-cycling testimonial decks, and live status pulses. Plus four hover patterns where the effect is the topic itself: cursor spotlight, holographic foil glare, corner ribbon slide, and horizontal accordion expand. Every card is scoped under a .ac-NN prefix for no-collision pasting, guards prefers-reduced-motion, animates compositor-only properties, and ports unchanged to React, Vue, Svelte, Astro, Next.js and Tailwind.

22 CSS Avatars preview

22 CSS Avatars

22 hand-coded CSS avatars for chat apps, team dashboards, comment threads, account menus, and social profiles. Covers circular and squircle shapes, gradient and conic story rings, hexagon clip-path crops, online status dots, notification count badges, verified checkmarks, stacked facepiles with plus-N overflow, initials fallbacks for users without photos, broken-image recovery, avatar pickers, and a size scale system where the ring, badge, and status dot all scale from a single custom property.

Search CodeFronts

Loading…