Input

Text input with start and end adornments, a clear button, a password visibility toggle, and presets for SSN and birthday.

import { Input, InputAdornmentButton } from "@plexui/vue/components/Input";

Examples

Overview

Variants

Sizing & roundness

size
gutterSize

Start adornment

Clear button

size

End adornment

Password with visibility toggle

variant
size

SSN input

variant
size

Birthday input

variant
size

Birthday with validation

variant
size

Disabled

Invalid

Plex UI also provides a FieldError component (@plexui/vue/components/FieldError) that pairs well with invalid inputs. It renders an error icon with a message styled for form validation; a long message wraps under its first line, and :icon="false" leaves the icon out where the message stands alone, such as under a centered code input.

Auto select text

Autofill extensions

With button

variant
size

Optical alignment

Use optically-align with either "start" or "end" to offset the gutter, aligning the input text with surrounding content. Works with Field: pass optically-align on the Field and it forwards to the child control automatically.

Input shares the unified 9-step size scale with Button, Select, SelectControl, and SegmentedControl: set the same size on adjacent controls and they'll align perfectly.

API

PropTypeDefaultDescription
value / v-model:valuestring | number—Controlled value; `update:value` fires on every input
default-valuestring | number—Initial value when uncontrolled
variant"outline" | "soft" | "ghost""outline"Visual style of the input; ghost has no border and no fill
size"3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl""md"Controls the size of the input
gutter-sizestring—Controls gutter on the edges; defaults to value from size
disabledbooleanfalseDisables the input visually and from interactions
read-only / readonlybooleanfalseMakes the input read-only and hides the clear button
invalidbooleanfalseMark the input as invalid
allow-autofill-extensionsbooleanfalse (true with name or type="password")Allow autofill extensions to appear in the input
auto-selectbooleanfalseSelect all contents of the input when mounted
startAdornment / endAdornmentslots—Content rendered at the start or end of the input
@clear(event: MouseEvent) => void—When set, displays a clear button that appears when the input has a value
@autofill() => void—Fires when the browser autofills the input
pillbooleanfalseFully rounded pill shape
optically-align"start" | "end"—Applies a negative margin using the current gutter to optically align with surrounding content

class applies to the container. Every other attribute and native listener (placeholder, style, maxlength, @input, @keydown, ...) goes to the <input>. The component exposes focus() and the input element.

InputAdornmentButton

PropTypeDefaultDescription
colorSemanticColor—Tint of the pressed (aria-pressed="true") state; the neutral primary-soft tint when unset
typestring"button"Button type

Styling

Input reads these component tokens. Override them at any scope to restyle it:

  • --input-border-color-invalid: border color invalid (default var(--color-border-danger-outline))
  • --input-gap-lg: gap lg (default 10px)
  • --input-gap-md: gap md (default 8px)
  • --input-gap-sm: gap sm (default 6px)
  • --input-gap-xs: gap xs (default 4px)
  • --input-outline-border-color: outline border color (default var(--color-border-primary-outline))
  • --input-outline-border-color-focus: outline border color focus (default var(--alpha-50))
  • --input-outline-border-color-hover: outline border color hover (default light-dark(var(--alpha-25), var(--alpha-30)))
  • --input-placeholder-text-color: placeholder text color (default var(--color-text-tertiary))
  • --input-soft-background-color: soft background color (default var(--color-background-primary-soft-alpha))
  • --input-soft-border-color-focus: soft border color focus (default var(--alpha-20))
  • --input-text-color: text color (default var(--color-text))