A reusable Vue 3 input component with label, validation, and prefix/suffix slots for forms.
<!--
Source: https://github.com/themesberg/flowbite-vue | License: MIT | Copyright 2022 Themesberg (Crafty Dwarf LLC) company@themesberg.com
Provided via justclaw.it.com; keep this notice with the code.
-->
<template>
<div :class="wrapperClass">
<label
v-if="label"
:for="inputId"
:class="labelClass"
>{{ label }}</label>
<div :class="inputWrapperClass">
<div
v-if="$slots.prefix"
:class="prefixContainerClass"
>
<slot name="prefix" />
</div>
<input
v-bind="inputAttributes"
v-model="model"
:aria-describedby="ariaDescribedby"
:aria-invalid="validationStatus === 'error' ? true : undefined"
:autocomplete="autocomplete"
:class="inputClass"
:disabled="disabled"
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key