Skip to content

Input

Input with floating label and error shake animation, suitable for most text input scenarios.

Basic Usage

vue
<AInput v-model="value" label="Username" placeholder="Enter username" />

Error State

On error, the input triggers a horizontal shake animation (spring easing) and shows the error message.

vue
<AInput
  v-model="value"
  label="Email"
  :error="hasError"
  error-message="Invalid email format"
/>

Disabled

vue
<AInput model-value="Locked" disabled />

API

Props

NameTypeDefaultDescription
modelValuestring''Bound value
type'text' | 'password' | 'email' | 'number' | 'search''text'Native type
placeholderstringPlaceholder text
labelstringFloating label text
disabledbooleanfalseDisabled
readonlybooleanfalseRead-only
errorbooleanfalseError state
errorMessagestringError message text

Emits

NameParametersDescription
update:modelValuestringValue updated
focusFocusEventInput focused
blurFocusEventInput blurred

Exposed Methods

NameDescription
focus()Focus the input

MIT License