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";

On Phone, put an input in a row of a FieldGroup, as the Settings Forms do. The row is its frame and sets its height, insets and type, so the Phone previews show rows without the size, gutter-size, pill and variant controls.

Examples

Overview

Variants

state

Value at the end

Values in a column

Value under the label

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.

Sizing & roundness

0/16

Adornments

position
$

Clear button

Password with visibility toggle

SSN input

Birthday input

Birthday with validation

Behavior

With button

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. On Phone, a row starts its label and its text at the row's inset, so there is nothing to offset and this example has no Phone switch.

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. On a phone with touch.css, 3xs to xl are all 44px: a 3xs, 2xs or xs field takes the height, 17px text and gutter of sm.

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))