All skills
Skillintermediate
Component specification
A versatile text input component for collecting user text, numbers, passwords, and other types of single-line or multi-line data. Supports various input types, validation states, and customizable appearance through slots.
Claude Code Knowledge Pack7/10/2026
Overview
Component specification
A versatile text input component for collecting user text, numbers, passwords, and other types of single-line or multi-line data. Supports various input types, validation states, and customizable appearance through slots.
- Component Name: N8nInput
- Figma Component: Input
- Element+ Component: ElInput
- Reka UI Component: N/A (no direct equivalent - will use native HTML input with Editable component for enhanced features)
- Nuxt UI Component: Input
Public API Definition
Props
modelValue?: string | number | null- The bound value of the input (v-model). Default:''type?: InputType- Type of input field. Values:'text' | 'textarea' | 'password' | 'number' | 'email'. Default:'text'size?: InputSize- Size of the input. Values:'xlarge' | 'large' | 'medium' | 'small' | 'mini'. Default:'large'placeholder?: string- Placeholder text displayed when input is empty. Default:''disabled?: boolean- Whentrue, prevents user interaction and dims the input. Default:falsereadonly?: boolean- Whentrue, the input is read-only and cannot be edited. Default:falseclearable?: boolean- Whentrue, displays a clear button (×) when input has a value. Default:falserows?: number- Number of rows for textarea type. Default:2maxlength?: number- Maximum number of characters allowed.autosize?: boolean | { minRows?: number; maxRows?: number }- Auto-resize textarea height based on content. Whentrue, auto-sizes without limits. Object form specifies min/max row constraints. Only applies whentype="textarea". Default:falseautofocus?: boolean- Whentrue, automatically focuses the input on mount. Default:falseautocomplete?: InputAutocomplete- HTML autocomplete attribute. Values:'off' | 'on' | 'new-password' | 'current-password' | 'given-name' | 'family-name' | 'one-time-code' | 'email'. Default:'off'name?: string- HTML name attribute for the input element.
Events
update:modelValue- Emitted when input value changes. Payload:[value: string]input- Emitted when input value changes (for backwards compatibility). Payload:[value: string]focus- Emitted when input gains focus. Payload:[event: FocusEvent]blur- Emitted when input loses focus. Payload:[event: FocusEvent]keydown- Emitted on keydown event. Payload:[event: KeyboardEvent]
Slots
prefix- Content inside input box, before the text (typically for search icons)suffix- Content inside input box, after the text (typically for icons or indicators)prepend- Content outside input box, before the input (typically for labels or grouped buttons)append- Content outside input box, after the input (typically for units or grouped buttons)
Exposed Methods
focus(): void- Programmatically focus the input elementblur(): void- Programmatically blur the input elementselect(): void- Programmatically select all text in the input
Template usage examples
Basic text input:
<script setup lang="ts">
const username = ref('')
</script>
<template>
</template>
Search input with icon and clear button:
<script setup lang="ts">
const searchQuery = ref('')
</script>
<template>
<template #prefix>
</template>
</template>
Textarea with fixed rows:
<script setup lang="ts">
const description = ref('')
</script>
<template>
</template>
Auto-resizing textarea:
<script setup lang="ts">
const message = ref('')
</script>
<template>
</template>
Disabled input:
<script setup lang="ts">
</script>
<template>
</template>
Input with suffix icon:
<script setup lang="ts">
const name = ref('')
</script>
<template>
<template #suffix>
</template>
</template>
Input with keydown handler:
<script setup lang="ts">
const value = ref('')
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Enter') {
console.log('Submitted:', value.value)
}
if (event.key === 'Escape') {
value.value = ''
}
}
</script>
<template>
</template>
Using exposed methods:
<script setup lang="ts">
const inputRef = ref()
const value = ref('')
const focusInput = () => {
inputRef.value?.focus()
}
const selectAll = () => {
inputRef.value?.select()
}
</script>
<template>
<div>
</div>
</template>