Atom · Input

Input Fields

A complete set of Apple-inspired form primitives — standard, glassmorphism, floating-label, OTP/PIN, compound, and more. All colours resolve from colors.css tokens. Zero hex literals in input.css.

All styles live in /Atom/input/input.css. To change any colour, edit colors.css only — every component adapts automatically including dark mode.

Standard Inputs

The base .input class covers every native input type. Add .input-sm or .input-lg for size variants. All inputs sit on a tinted --color-bg-grouped stage so the white surface is clearly visible.

Text & Email

As it appears on your government-issued ID.

Sizes

States

Please enter a valid email address.
Looks good!

With Icons

Password

Use letters, numbers and symbols.

Number Stepper

Phone Number

Select / Dropdown

Date & Time

Textarea

Range Slider

₹5,000
3★

Checkbox & Radio

Compound / Row Layout

Input Groups

https://
/ night

Floating Label

Tag Input

WiFi Pool Parking
Press Enter to add · × to remove.

OTP / PIN

Squared single-character cells. Auto-advances on input, backtracks on delete, supports clipboard paste and arrow-key navigation. Classes: .otp-input · .otp-input-lg · .otp-input-sm

Standard · 6-digit OTP

Large · 4-digit PIN

Error state

Incorrect code. Please try again.


Glassmorphism Set

Apple liquid-glass aesthetic — frosted backdrop blur, luminous border, layered depth shadow. Wrap in .glass-panel over a coloured / blurred background stage. Classes: .input-glass · .textarea-glass · .select-glass · .input-glass-search

Glass Sign-in Card

Welcome back

Sign in to Holidayseva

By continuing you agree to our Terms

Glass OTP Verification

Verify your number

6-digit code sent to +91 98765 43210

Didn't receive? Resend

Glass Textarea & Select


Specifications

Height SM
34 px
Height MD (default)
42 px
Height LG
52 px
OTP cell standard
48 × 56 px
OTP cell large
62 × 70 px
Border radius MD
10 px
Border default
--color-border
Border focus
--color-border-focus
Focus ring (standard)
--focus-ring-blue
Focus ring (OTP/glass)
--focus-ring coral
Surface
--color-surface
Glass bg
--color-glass-bg

JavaScript API

Lightweight helpers in input.js — no framework required.

Function Signature Description
togglePw(btn, id) (El, string) Toggles password visibility; updates aria-label and eye icon.
step(id, delta) (string, number) Increments / decrements number input, respects min/max.
countChars(el, id, max) (El, string, number) Updates textarea character counter; adds .is-near / .is-max.
syncRange(el, id, …) (El, string, str?, str?) Syncs CSS --pct track fill and value label for range inputs.
initOTP(groupId) (string) Wires auto-advance, backspace, paste and arrow keys for an OTP group.
handleTag(event) (KeyboardEvent) Creates a tag pill on Enter inside .tag-input-inner.
removeTag(btn) (El) Removes the closest .tag-pill from the tag input wrap.

Integration

Three file includes — tokens first, then component CSS, then JS.

<!-- ① Token layer — always first -->
<link rel="stylesheet" href="/colors.css" />

<!-- ② Component CSS — zero hex literals inside -->
<link rel="stylesheet" href="/Atom/input/input.css" />

<!-- ③ Helper JS (OTP, password, range, stepper, tags) -->
<script src="/Atom/input/input.js" defer></script>

<?php
$partials = __DIR__ . '/../../';
?>
<?php include $partials . 'header.php'; ?>
<?php include $partials . 'drawer_sidebar.php'; ?>

<div class="page-layout">
  <aside class="sidebar-left" style="z-index:10000;">
    <?php include $partials . 'left_sidebar.php'; ?>
  </aside>

  <main class="main-content">
    <!-- content -->
  </main>

  <aside class="sidebar-right">
    <?php include $partials . 'right_sidebar.php'; ?>
  </aside>
</div>
Never write hex, rgba(), or hsl() literals in input.css. All colour decisions live exclusively in colors.css.

Accessibility

  • Every <input> must have an associated <label> via matching for/id. Never use placeholder as the only label.
  • Error states: set aria-invalid="true" on the input and aria-describedby pointing to the error message.
  • OTP groups: role="group" + aria-label on the wrapper; individual aria-label="Digit N" on each cell.
  • Focus rings must never be suppressed without a custom high-contrast replacement. Tokens --focus-ring and --focus-ring-blue meet 3:1 contrast.
  • Password toggle: aria-label must reflect current action — "Show password" or "Hide password" — not a static label.
  • Range sliders: expose the current value via aria-valuenow, aria-valuemin, and aria-valuemax.
  • Tag input wrap: add role="group" + aria-label; each pill remove button needs a descriptive aria-label.
  • All decorative SVGs must carry aria-hidden="true".