Skip to content
Theme:

Ui3nInput

Text input component with validation, icons, states, and various customization options.

Props

NameTypeDefaultDescription
idstring | undefined

Root element id

modelValue*string""

Input value

labelstring | undefined""

Input label

type"text" | "password" | undefined"text"

Input type

size"regular" | "large" | undefined"regular"

Input field size (height)

placeholderstring | undefined""

Input placeholder

clearableboolean | undefinedfalse

Whether input is clearable

autofocusboolean | undefinedfalse

Whether input is autofocus

readonlyboolean | undefinedfalse

Whether input is readonly

namestring | undefined

Input name attribute (for use in native forms)

maxlengthnumber | undefined

Maximum length of input value

minlengthnumber | undefined

Minimum length of input value

autocompletestring | undefined"off"

Autocomplete attribute

rules((v: unknown) => string | boolean)[] | undefined[]

Validation rules

validateAtStartupboolean | undefinedfalse

Whether to validate at startup

hideBottomSpaceboolean | undefinedfalse

Whether to hide bottom space

displayStateMode"error" | "success" | undefined

Display state mode

displayStateWithIconboolean | undefinedfalse

Whether to display state with icon

displayStateMessagestring | undefined""

Display state message

disabledboolean | undefinedfalse

Whether input is disabled

Events

Event NameArguments / Value TypeDescription
update:modelValuevalue: string
clear
entervalue: { value: string; altKey: boolean; ctrlKey: boolean; shiftKey: boolean; metaKey: boolean; }
initvalue: HTMLInputElement
focusvalue: Event
blurvalue: Event
changevalue: string
inputvalue: string
keydownvalue: KeyboardEvent
escapevalue: Event
update:validvalue: boolean

Slots

Slot NameScope Props (v-slot)Description
#prepend-icon

Slot for prepend icon (displayed at the start of the input)

#append-icon

Slot for append icon (displayed at the end of the input)

Public Methods & Exposes

Method NameSignature / TypeDescription
inputElement()HTMLInputElement | null

Reference to the input DOM element

isDirty()boolean

Whether the input has been modified

isFocused()boolean

Whether the input is currently focused

clearValue()() => void

Clear the input value

Usage Examples

Basic usage

Basic usage

Simple input with v-model and placeholder

Label and sizes

Label and sizes

Input with label and different sizes: regular and large

Clearable input

Clearable input

Input with clear button using the clearable prop

Icon slots

Icon slots

Using prepend-icon and append-icon slots

Validation and states

Validation and states

Input validation with rules and display states (success, error)

Looks good!
This field has an error

Disabled and readonly

Disabled and readonly

Input in disabled and readonly states

Events

Events

Input events: input, change, enter, focus, blur, clear, escape

No events yet. Interact with the input above.