Skip to content

Field API

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

Import

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

Props

NameTypeDefaultDescription
addBottomSpacebooleanfalseAdds spacing under the field that is consistent whether hint/error text is displayed.
disabledbooleanfalseIndicates whether the field is disabled.
errorIdstringundefinedID for the error text element; useful for aria-errormessage
errorTextstringundefinedError text to display. Replaces `hintText` (if provided) & adds error styling.
fieldsetbooleanfalseIndicates wheter the field is a fieldset or not
hintTextstringundefinedDisplays text below the input; hidden when the isReadOnly prop is truthy.
idstringundefinedID for the Label and Input; must be unique
isReadOnlyboolean-Whether it's a readonly field.
isRequiredbooleanfalseWhether the field is required.
labelstringundefinedLabel to render above the input.
showOptionalInLabelbooleanfalseShow "(optional)" to the right of the label text

Slots

NameDescription
default
hintfor displaying hint text below the field

Events

None