Skip to content

Form Input Component

Overview

The <form-input> component provides a standardized input field for forms in the Qelos template ecosystem. It wraps the Element Plus input components with additional functionality and styling consistent with the Qelos design system.

Usage

html
<form-input
  label="Username"
  v-model="username"
  placeholder="Enter your username"
  required
></form-input>

Props

PropTypeDefaultDescription
labelString-Label text for the input field
modelValueAny-The value of the input (use with v-model)
placeholderString-Placeholder text when input is empty
requiredBooleanfalseWhether the field is required
disabledBooleanfalseWhether the input is disabled
typeString'text'Input type (text, password, number, etc.)
clearableBooleanfalseWhether the input can be cleared
showPasswordBooleanfalseWhether to show password toggle for password fields
errorString-Error message to display
hintString-Hint text to display below the input

Events

EventParametersDescription
update:modelValue(value: any)Emitted when the input value changes
focus(event: FocusEvent)Emitted when the input is focused
blur(event: FocusEvent)Emitted when the input loses focus
change(value: any)Emitted when the input value changes and loses focus

Examples

Basic Usage

html
<form-input
  label="Email"
  v-model="email"
  placeholder="Enter your email"
  required
></form-input>

With Error Message

html
<form-input
  label="Password"
  v-model="password"
  type="password"
  show-password
  :error="passwordError"
></form-input>

With Hint Text

html
<form-input
  label="API Key"
  v-model="apiKey"
  hint="Your API key can be found in your account settings"
></form-input>

Disabled Input

html
<form-input
  label="Username"
  v-model="username"
  disabled
></form-input>

© Velocitech LTD. All rights reserved.

Released under the Apache License 2.0.