Skip to content

FormInput

Text input with v-model binding and optional debounce.

bash
npm install @vuecs/form-controls

Basic usage

Bound: (empty)

vue
<script setup lang="ts">
import { VCFormInput } from '@vuecs/form-controls';
import { ref } from 'vue';

const value = ref('');
</script>

<template>
    <VCFormInput v-model="value" placeholder="Enter your email" />
</template>
css
@import "tailwindcss";
@import "@vuecs/design";

/* Required only if you use the input-group variant (prepend/append). */
@import "@vuecs/form-controls";

@custom-variant dark (&:where(.dark, .dark *));

Props

PropTypeDefaultDescription
modelValuestring''The bound value
typestring'text'Native input type
debouncenumber0Debounce input updates by N milliseconds
groupbooleanfalseRender with input-group prepend/append wrappers
groupPrepend / groupAppendbooleanfalseShow prepend/append addon slots
groupPrependContent / groupAppendContentstringInline addon content (alternative to slots)

placeholder, disabled, etc. are forwarded to the native <input> via attrs.

Events

EventPayloadDescription
update:modelValuestring | numberv-model update

See also

Released under the Apache 2.0 License.