Skip to content

Input

Enter text with support for labels, validation, and form submission.

Demos

Size
Variant

Usage

vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'

const items = [
  { value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>

<template>
  <Accordion :items="items" />
</template>

Installation

Complete the shared installation. Copy Input.vue and index.ts into app/components/ui/input/.

API

Variants and defaults

PropValuesDefault
sizexs, sm, md, lg, xlsm
variantoutline, soft, bareoutline

Props

PropTypeDefaultDescription
idstring—Input id. Inherited from Field when omitted.
namestring—Form field name. Inherited from Field when omitted.
typeInputType"text"Native input type for text-like inputs.
placeholderstring—Placeholder text.
autocompletestring—Native autocomplete setting.
inputmodeInputProps["inputmode"]—Native input mode hint.
minlengthnumber—Native minimum text length.
maxlengthnumber—Native maximum text length.
patternstring—Native validation pattern.
requiredbooleanfalseRequired state.
disabledbooleanfalseDisabled state.
readonlybooleanfalseRead-only state.
invalidbooleanfalseSets aria-invalid and data-akaza-invalid.
ariaLabelstring—Accessible label when no visible label exists.
ariaDescribedbystringfield description/errorAccessible description ids.
uiInputUi—Classes for the input element.

Events

EventPayloadDescription
value-change(value, details)Fired before model updates. details.cancel() prevents the update.

Keyboard

Input preserves native keyboard behavior for its type, inputmode, autocomplete, selection, clipboard, and form submission. Akaza does not replace browser text editing shortcuts. Enter submits an owning form when native HTML rules permit it.