Input

stable llms.txt

Flexible input component with icons, placeholders, and all HTML input types.

Installation

bash
ts

Input.Root

The styled container — wrap every control with this

Why a compound component?

Input.Root is the shared styled shell. Every control lives inside one. Other components (dropdowns, selects) can reuse the same shell for visual consistency without rebuilding it.

With Icon

Prefix or suffix any element using Input.Icon.

$
.00

Preset Configuration

Customize the input appearance using presets

Text Controls

Plain text, password, search

TextControl

The standard text input. Prefer this over Input.Control for type='text'.

Password

Password input with show/hide toggle capability.

Search

Search text input with semantic markup.

Numeric Controls

Numbers and money

NumberControl

Numeric input with increment/decrement buttons and step.

CurrencyControl

Locale-aware currency input. Arrow Up/Down to increment (Shift×10, Alt×0.1).

Date & Time Controls

Segment-based pickers with keyboard navigation and rollover

TimeControl

12 or 24-hour segment picker with optional seconds and AM/PM.

HH : MM --

DateControl

Segment-based date picker (YYYY-MM-DD). Day clamps to month boundaries.

MM / DD / YYYY · HH : MM

DateTimeControl

Combined date + time picker with full rollover cascade across all segments.

MM / DD / YYYY · HH : MM

Contact & Address Controls

Syntax-highlighted inputs for structured contact data

Highlight CSS variables

These controls color their segments via --input-hl-* CSS variables. Define them in your theme to enable color; omit them for plain monochrome text.

EmailControl

Email with local / @ / domain / TLD segment coloring.

UrlControl

URL with protocol, host, path, search, and hash segment coloring.

PhoneControl

Masked phone input. # = required digit, [#] = optional. Segment map controls coloring.

LocationControl

Coordinate input (lat, lng) in decimal degrees or DMS. Optional geolocation button.

Media & Selection Controls

File upload, color picker, and verification codes

FileControl

File picker with accept filter and customizable trigger snippet.

ColorControl

Segmented CSS color editor. Auto-detects format from value. Pair with ColorSwatch for a live preview.

oklch ( 0.650 0.180 253.0deg )

OtpControl

One-time password slots with keyboard navigation, paste support, and oncomplete callback.

API Reference

Compatibility

Components and patterns designed to work with the Input module

Works inside Input.Root

Input.TextControl

Plain text input with bond wiring.

Input.PasswordControl

Password input with show/hide toggle.

Input.EmailControl

Email with local/domain/TLD segment coloring.

Input.UrlControl

URL with protocol, host, path and hash coloring.

Input.PhoneControl

Masked phone input with segment color map.

Input.NumberControl

Numeric stepper with increment/decrement buttons.

Input.CurrencyControl

Locale-aware currency input with formatted overlay.

Input.TimeControl

Segment-based 12/24h time picker.

Input.DateControl

Segment-based date picker.

Input.DateTimeControl

Combined date + time picker.

Input.ColorControl

CSS color editor with per-channel segments.

Input.ColorSwatch

Live color preview — reads bond automatically.

Input.OtpControl

One-time password slot grid.

Input.FileControl

File upload trigger with custom snippet.

Input.LocationControl

Coordinates input with lat/lng bindables.

Input.Icon

Leading or trailing icon slot.

Input.Placeholder

Floating overlay placeholder.

Related standalone components

Bond-free color preview square. Use outside of Input.Root when you need a standalone swatch. Input.ColorSwatch is its bond-connected counterpart.

Popover

Input.Root can act as a popover trigger for any dropdown — combine it with a Popover to build custom pickers, suggestions, or autocomplete panels.

Color Picker

Input.ColorControl handles raw color string editing. Pair it with a full color picker popover for a visual hue/saturation canvas alongside the segment input.

Time Picker

Input.TimeControl provides keyboard-driven segment editing. Pair it with a clock-face or scrollable time picker popover for mouse/touch selection.

Date Picker / Calendar

Input.DateControl and Input.DateTimeControl handle typed date entry. Pair them with a Calendar popover for click-to-select.

Accessible label element. Pair with Input.Root via htmlFor or by wrapping the input.

Wraps inputs with label, helper text, and validation messages. Designed to compose with any Input control.

Accessibility

  • Proper label association with for/id
  • Error message linking with aria-describedby
  • Keyboard accessible
  • Focus visible indicators
  • Screen reader friendly

© 2026 Svelte Atoms. Open source under the MIT license.

Built with Svelte 5 · Runes · TailwindCSS