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
Name | Type | Default | Description |
---|---|---|---|
addBottomSpace | boolean | false | Adds spacing under the field that is consistent whether hint/error text is displayed. |
disabled | boolean | false | Indicates whether the field is disabled. |
errorId | string | undefined | ID for the error text element; useful for aria-errormessage |
errorText | string | undefined | Error text to display. Replaces `hintText` (if provided) & adds error styling. |
fieldset | boolean | false | Indicates wheter the field is a fieldset or not |
hintText | string | undefined | Displays text below the input; hidden when the isReadOnly prop is truthy. |
id | string | undefined | ID for the Label and Input; must be unique |
isReadOnly | boolean | - | Whether it's a readonly field. |
isRequired | boolean | false | Whether the field is required. |
label | string | undefined | Label to render above the input. |
showOptionalInLabel | boolean | false | Show "(optional)" to the right of the label text |
Slots
Name | Description |
---|---|
default | |
hint | for displaying hint text below the field |
Events
None