Skip to content
Velkin LogoVelkin Logo
Velkin
VELKIN/UI

Modern UI components for product teams and their AI agents. Lit core, typed wrappers, live MCP.

sales@velkinui.com

Product

  • Docs
  • Components
  • Studio
  • Pricing

Resources

  • Quick start
  • Blog
  • Changelog
  • Roadmap
  • Status

Project

  • About
  • Contact
  • License
  • Privacy
  • Terms

© 2026 Velkin. MIT core · Pro licenses available.

VELKIN

Input

A text field component with label, hint, and validation.

vu-input · @velkin/react/input

Copy page

Import

React
npm i @velkin/react

import { VuInput } from "@velkin/react/input";

Examples

API

Props

PropTypeDefaultDescription
variantVuInputVariant"default"Field chrome recipe. Default: `"default"`.
toneVuInputTone"normal"Neutral chrome weight. Default: `"normal"`.
sizeVuInputSize"md"Field scale. Default: `"md"`.
radiusVuInputRadius"md"Corner preset (`none`/`sm`/`md`/`lg`/`full`). Default: `md`.
blockbooleanfalseStretches the field to the container width. Default: `false`.
namestring—Form field name. Default: `""`.
defaultValuestring—Uncontrolled initial value; HTML attribute is `value`. Default: `""`.
formIdstring | null—ID of an external `<form>`; HTML attribute is `formid`. Default: `null`.
disabledboolean—Non-interactive state. Default: `false`.
readonlyboolean—Read-only; keeps focus without editing. Default: `false`.
requiredbooleanfalseMarks the field required for form validation. Default: `false`.
requiredMessagestring—Message when `required` fails. Default: `"This field is required."`.
valueVuInputValue""Current value; `number` when `type="number"`.
placeholderstring""Placeholder or file-input fallback label.
labelstring""Plain-text label; slotted `label` wins when assigned.
hintstring""Helper text; `hint` slot wins when assigned.
typeVuInputType"text"Native type, or `textarea` / `file`. Default: `"text"`.
validationsVuInputValidation[]—Custom validators returning `true` or an error string.
compactbooleanfalseTighter vertical spacing. Default: `false`.
loadingbooleanfalseShows a trailing spinner. Default: `false`.
showErrorsbooleanfalseShows validation messages after `validationActive`. Default: `false`.
clearablebooleanfalseShows a clear button when the field has a value. Default: `false`.
showNumberButtonsbooleanfalseShows +/- controls for `type="number"`. Default: `false`.
showPasswordTogglebooleantrueShows a password visibility toggle. Default: `true`.
stepnull | stringnullNative `step` for number inputs.
minnull | stringnullNative `min` constraint.
maxnull | stringnullNative `max` constraint.
autocapitalizestring"off"Native `autocapitalize`. Default: `"off"`.
autocompletestring"off"Native `autocomplete`. Default: `"off"`.
spellcheckbooleanfalseNative `spellcheck`. Default: `false`.
dirstring"ltr"Text direction. Default: `"ltr"`.
rowsnumber6Textarea row count. Default: `6`.
resizablestring"none"Textarea resize mode. Default: `"none"`.
acceptstring""File input accept filter.
multiplebooleanfalseAllows multiple files when `type="file"`. Default: `false`.
inputmodenull | stringnullNative `inputmode` hint.
enterkeyhintnull | stringnullNative `enterkeyhint` for virtual keyboards.
patternnull | stringnullNative `pattern` validation regex.
minlengthnull | numbernullNative minimum string length.
maxlengthnull | numbernullNative maximum string length.
listnull | stringnullID of a `<datalist>` to associate.
nativeSizenull | numbernullNative `size` attribute (character width).
autofocusbooleanfalseFocuses the control on connect. Default: `false`.
capturebooleanfalseEnables capture on file inputs. Default: `false`.
ariaLabelstring""Accessible name when no visible label is present.
ariaLabelledbynull | stringnullIDs of elements that label the control.
idstring""Host id; also prefixes internal control ids when set.
validationActivebooleanfalseShows validation affordances after interaction. Default: `false`.
invalidbooleanfalseReflects validation failure state. Default: `false`.

Events

EventDetailDescription
vu-changeVuInputChangeDetailWhen the value updates.
vu-clearVuInputClearDetailAfter the value is cleared.
vu-invalidVuInputInvalidDetailWhen validation messages are recomputed.
vu-fileVuInputFileDetailAfter file selection changes.

Slots

SlotDescription
labelRich label markup; takes precedence over string `label` when assigned.
hintOptional helper copy (HTML); overrides string `hint` when assigned.
errorReplaces default validation message list when assigned.
startLeading icon or affix inside the field container.
endTrailing icon or affix inside the field container.

CSS parts

PartDescription
fieldColumn stacking label, control row, hint, and error.
labelLabel wired to the native control.
startLeading affix wrapper.
endTrailing affix wrapper.
containerField chrome wrapping the native control and actions.
inputNative `<input>` or `<textarea>`.
toggle-passwordPassword visibility toggle.
clear-buttonClear value control.
loading-indicatorLoading spinner on the trailing edge.
number-stepperIncrement/decrement button group for `type="number"`.
buttonShared part on stepper buttons.
button--decreaseDecrease button.
button--increaseIncrease button.
hintHelper text region.
error-messageValidation error region.
error-lineOne default validation string.
file-infoSelected file count and size readout.
file-labelVisible label for file inputs.

Methods

MethodDescription
validateInput- Recomputes validation messages and returns whether the field is valid.
clear- Clears the value and emits `vu-clear`.
focus- Focuses the native control.

Types

NameDefinition
number | null
null | number
string | null
null | string
VuInputChangeDetail
{ value: string | number; previous: string | number; }
VuInputClearDetail
{ value: string | number; }
VuInputFileDetail
{
  files: File[];
  fileName: string;
  totalSize: number;
  fileCount: number;
}
VuInputInvalidDetail
{ errors: string[]; }
VuInputRadius
"sm" | "md" | "lg" | "none" | "full"
VuInputSize
"sm" | "md" | "lg"
VuInputTone
"subtle" | "normal" | "strong"
VuInputType
string
VuInputValue
null | string | number
VuInputVariant
"outline" | "default" | "underline"

Related

Inputs

  • Advanced FilterAn advanced filter component with expression input and visual builder.
  • ButtonA clickable button component with multiple variants and states.
  • Button GroupA button group component with shared styling and optional selection.
  • CheckboxA checkbox component with label, hint, and validation.
  • Checkbox GroupA checkbox group component with shared label and validation.
  • Color AreaA two-dimensional color picker component for saturation and brightness.

Guides

  • FormsFormData, VuForm, and validation
  • EventsonVu* / v-model / e.detail
  • Appearancevariant, color, tone, size

Browse

  • Previous: FormEarlier in the sidebar
  • Next: OtpLater in the sidebar
  • All componentsBrowse the full index