Skip to content

Input

te-input wraps a native <input>, so every value you pass through reaches the real element. Non-HTML props such as size or helperText are kept off it.

Sizes

vue
<te-input size="small" placeholder="small" />
<te-input size="medium" placeholder="medium" />
<te-input size="large" placeholder="large" />

Helper text and invalid state

We never share it.
That address is not valid.
vue
<te-input placeholder="Email" helper-text="We never share it." />
<te-input placeholder="Email" invalid helper-text="That address is not valid." />

Icons

A clickable icon emits its own event instead of focusing the field.

vue
<te-input placeholder="Search" left-icon="search" />
<te-input placeholder="Star" right-icon="star" right-icon-clickable />

Password

A type="password" field gets a reveal toggle on its own — no wiring needed. Clicking it switches the field to text and flips the icon.

Click the eye. Pass :revealable='false' to suppress it, or set your own right-icon to take over.

vue
<te-input v-model="password" type="password" placeholder="Password" />
<te-input v-model="password" type="password" :revealable="false" />

The toggle is a real <button> with aria-label and aria-pressed, so it is reachable by keyboard. Its labels are Show password / Hide password.

Floating label

The label uses placeholder as its text.

Empty above, filled below — the label shrinks and rises once the field has a value.

vue
<te-input floating placeholder="Full name" />
<te-input floating placeholder="Full name" v-model="name" />

Disabled and readonly

vue
<te-input placeholder="Disabled" disabled />
<te-input model-value="Read only" readonly />

Props

PropTypeDefaultDescription
modelValuestring | number''Supports v-model.
idstringgeneratedFalls back to a stable useId() value, linked to the floating label.
type'text' | 'number' | 'email' | 'search' | 'password' | 'tel' | 'url''text'Native input type.
size'small' | 'medium' | 'large''medium'Padding and font size.
placeholderstringundefinedPlaceholder, and the floating label text.
helperTextstringundefinedHint below the field. Turns red when invalid.
invalidbooleanfalseRed border and aria-invalid.
floatingbooleanfalseFloating label style.
disabledbooleanfalseDisables the field.
readonlybooleanfalseRead-only field.
name form min max minlength maxlength step patternstring | numberundefinedForwarded to the native input.
revealablebooleantrue for type="password" without a custom rightIconShows a reveal toggle that switches the field between password and text.
leftIcon / rightIconstring''Icon name. rightIcon is ignored when type="number". A custom rightIcon on a password field replaces the reveal toggle.
leftIconFamily / rightIconFamilystringundefinedCustom icon family.
leftIconClass / rightIconClassstringderived from sizeReplaces the default icon sizing classes.
leftIconClickable / rightIconClickablebooleanfalseMakes the icon emit a click event.

Events

EventPayloadDescription
update:modelValuestring | numberValue changed.
blur focusFocusEventForwarded from the input.
changeEventForwarded from the input.
keydown keypress keyupKeyboardEventForwarded from the input.
clickMouseEventForwarded from the input.
left-icon-click / right-icon-clickMouseEventOnly when the icon is clickable.

Released under the MIT License.