Skip to content

Input

Single-line text input field for user text entry.

Import

ts
import { Input } from '@heroui-vue/vue'

Usage

Basic

<template>
  <div class="flex flex-col gap-3">
    <Input placeholder="Primary input" />
    <Input variant="secondary" placeholder="Secondary input" />
    <Input placeholder="Disabled" :disabled="true" />
  </div>
</template>

<script setup>
import { Input } from '@heroui-vue/vue'
</script>

Input Types

<template>
  <div class="flex flex-col gap-3">
    <Input type="text" placeholder="Text input" />
    <Input type="email" placeholder="Email input" />
    <Input type="password" placeholder="Password input" />
    <Input type="number" placeholder="Number input" />
  </div>
</template>

<script setup>
import { Input } from '@heroui-vue/vue'
</script>

Disabled & Full Width

<template>
  <div class="flex flex-col gap-3">
    <Input placeholder="Disabled input" :disabled="true" />
    <Input placeholder="Full width" :full-width="true" />
  </div>
</template>

<script setup>
import { Input } from '@heroui-vue/vue'
</script>

API

Props

PropTypeDefaultDescription
typestring'text'HTML input type
placeholderstringundefinedPlaceholder text
disabledbooleanfalseWhether the input is disabled
readonlybooleanfalseWhether the input is read-only
requiredbooleanfalseWhether the input is required
modelValuestringundefinedv-model value

Events

EventPayloadDescription
update:modelValuestringEmitted when input value changes
inputInputEventNative input event
changeEventNative change event
focusFocusEventEmitted when input receives focus
blurFocusEventEmitted when input loses focus

Accessibility

  • Proper label association with id and for attributes
  • Keyboard navigation support
  • Screen reader friendly
  • Focus visible indicator

Released under the Apache-2.0 License.