Skip to content

Input

Text input component with icon support, size variants, and validation states. Wraps native input with InputWrapper for consistent styling.

Import

typescript
import { Input } from 'vuiii'

Basic Usage

vue
// Basic usage import { Input } from 'vuiii'

<Input v-model="name" placeholder="Enter your name" />

Props

PropTypeDefaultDescription
modelValuestring | number | Date | null-Bound value (use with v-model)
prefixIconstring-Icon name to show before the input
suffixIconstring-Icon name to show after the input
size'small' | 'normal' | 'large''normal'Input size
invalidbooleanfalseApplies the invalid/error styling
pillbooleanfalseRounded pill shape
disabledbooleanfalseDisables the input (native attribute)
placeholderstring-Placeholder text (native attribute)
typestring'text'Native input type (native attribute)
valueAsNumberbooleanfalseEmits the value as a number (for type="number")
valueAsDatebooleanfalseEmits the value as a Date (for type="date")
inputClassany-Class applied to the nested <input> element

Slots

SlotDescription
prefixContent before the input (replaces prefixIcon)
suffixContent after the input (replaces suffixIcon)

Events

EventPayloadDescription
prefix-icon-click-When the prefix icon is clicked
suffix-icon-click-When the suffix icon is clicked

More Examples

vue
// Different input types (passed via attrs)
<Input v-model="email" type="email" placeholder="Email" />
<Input v-model="password" type="password" placeholder="Password" />
<Input v-model="count" type="number" placeholder="Count" />
vue
// With icons
<Input v-model="search" prefixIcon="magnifying-glass" placeholder="Search..." />
<Input v-model="email" suffixIcon="envelope" placeholder="Email" />
vue
// With clickable icons (emits events)
<Input
  v-model="password"
  :suffix-icon="showPassword ? 'eye-slash' : 'eye'"
  :type="showPassword ? 'text' : 'password'"
  @suffix-icon-click="showPassword = !showPassword"
/>

Storybook

For interactive examples with all variants, see Input in Storybook.

Released under the MIT License.