Skip to content

Input API

API reference docs for the Stash Input component. Learn about the props, CSS, and other APIs of this exported module.

Import

ts
import Input from '@leaflink/stash/Input.vue';

Props

NameTypeDefaultDescription
addBottomSpaceboolean-Adds spacing under the field that is consistent whether or not hint/error text is displayed.
autocompletestring 'off' Autocomplete takes in a string of off or on
disabledbooleanfalseIndicates whether the input is disabled.
errorTextstringundefinedError text to display. Replaces `hintText` (if provided) & adds error styling.
hintTextstringundefinedDisplays text below the input; hidden when the isReadOnly prop is truthy.
idstringundefinedID for the Label and Input; must be unique
labelstringundefinedLabel to render above the input.
modelValuestring | numberValue for the input element.
placeholderstringundefinedPlaceholder text for the input. **Note:** placeholders should be used to display examples; they should not be used as labels because they are not accessible as labels. If a real label cannot be used, use the `aria-label` attribute.
showOptionalInLabelboolean-Show "(optional)" to the right of the label text
typeTSConditionalTypetextInput type. Excludes certain types that have a dedicated component. Note: For distinguishing between text & number internally, passing `number` will still render an input with a type of `text` (for localization).
valuestring | number | nullnull

Slots

NameDescription
prependrenders content on the left side of the input
appendrenders content on the right side of the input
hint

Events

NameDescription
update:model-valueEmitted when the input value changes.
changeEmitted when the input value changes.
focusEmitted when the input is focused
blurEmitted when the input is blurred